Task handlers with reasons and value based commands #682
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Development branches | |
on: | |
push: | |
branches: | |
- '*' # matches every branch that doesn't contain a '/' | |
- '*/*' # matches every branch containing a single '/' | |
- '**' # matches every branch | |
- '!master' | |
pull_request: | |
branches: | |
- '*' # matches every branch that doesn't contain a '/' | |
- '*/*' # matches every branch containing a single '/' | |
- '**' # matches every branch | |
- '!master' | |
workflow_dispatch: | |
inputs: | |
skip_tests: | |
description: "Skip tests?" | |
required: true | |
default: "false" | |
type: choice | |
options: | |
- "true" | |
- "false" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and run tests | |
steps: | |
# Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Expose branch name | |
run: echo ${{ github.ref }} | |
# Setup JDK and Maven | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
cache: maven | |
- name: Determine if Tests Should Be Skipped | |
id: check_skip_tests | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/skip-tests" ]]; then | |
echo "SKIP_TESTS=true" >> $GITHUB_ENV | |
elif [[ "${{ github.event.head_commit.message }}" == *"[skip-tests]"* ]]; then | |
echo "SKIP_TESTS=true" >> $GITHUB_ENV | |
elif [[ "${{ github.event.inputs.skip_tests }}" == "true" ]]; then | |
echo "SKIP_TESTS=true" >> $GITHUB_ENV | |
else | |
echo "SKIP_TESTS=false" >> $GITHUB_ENV | |
fi | |
# Prepare | |
- name: Prepare Maven Wrapper | |
run: chmod +x ./mvnw | |
# Build | |
- name: Build with Maven | |
run: | | |
if [[ "$SKIP_TESTS" == "true" ]]; then | |
./mvnw clean verify -U -B -ntp -T4 -DskipTests | |
else | |
./mvnw clean verify -U -B -ntp -T4 | |
fi | |
- name: Upload coverage to Codecov | |
if: github.event_name == 'push' && github.actor != 'dependabot[bot]' | |
uses: codecov/[email protected] | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} |