CI overhaul #35
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: Tests | |
| on: | |
| merge_group: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| # To run this locally, the following should be used: | |
| # > alias act='act --container-architecture linux/amd64 -P ubuntu-latest=quay.io/jamezp/act-maven' | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is_full_run: ${{ github.event_name == 'merge_group' || contains(github.event.pull_request.labels.*.name, 'Run Full Tests') }} | |
| steps: | |
| - run: exit 0 | |
| run-unit-tests: | |
| name: Run unit tests | |
| needs: [setup] | |
| uses: ./.github/workflows/_unit-tests.yml | |
| with: | |
| java_versions: ${{ needs.setup.outputs.is_full_run == 'true' && '"17","21","25"' || '"17"' }} | |
| run-docs-compilation-tests: | |
| name: Run docs compilation tests | |
| needs: [setup, run-unit-tests] | |
| if: needs.setup.outputs.is_full_run == 'true' | |
| uses: ./.github/workflows/_docs-compile-tests.yml | |
| secrets: inherit | |
| run-hcd-integration-tests: | |
| name: Run HCD integration tests | |
| needs: [setup, run-unit-tests] | |
| if: needs.setup.outputs.is_full_run == 'true' | |
| uses: ./.github/workflows/_hcd-integration-tests.yml | |
| secrets: inherit | |
| run-astra-integration-tests: | |
| name: Run Astra integration tests | |
| needs: [setup, run-unit-tests] | |
| if: github.event_name == 'merge_group' # We want to run this as little as possible to avoid messing up the shared Astra org | |
| uses: ./.github/workflows/_astra-integration-tests.yml | |
| secrets: inherit | |
| can-enqueue: | |
| name: Can enqueue | |
| needs: [setup, run-unit-tests] | |
| if: always() && needs.setup.outputs.is_full_run != 'true' && github.event_name != 'merge_group' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check outcomes | |
| run: | | |
| echo '${{ toJSON(needs) }}' | jq -e 'to_entries | map(.value.result == "success" or .value.result == "skipped") | all' | |
| can-merge: | |
| name: Can merge | |
| needs: [setup, run-unit-tests, run-docs-compilation-tests, run-hcd-integration-tests, run-astra-integration-tests] | |
| if: always() && needs.setup.outputs.is_full_run == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check outcomes | |
| run: | | |
| echo '${{ toJSON(needs) }}' | jq -e 'to_entries | map(.value.result == "success" or .value.result == "skipped") | all' |