Overhaul test infrastructure #1527
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: CI | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'release-' | |
| tags: '*' | |
| paths-ignore: | |
| - 'docs/**' | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| # Cancel intermediate builds: only if it is a pull request build. | |
| cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
| jobs: | |
| setup-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| groups: ${{ steps.mk.outputs.groups }} | |
| version: ${{ steps.mk.outputs.version }} | |
| os: ${{ steps.mk.outputs.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - id: mk | |
| shell: bash | |
| run: | | |
| # Auto-discover test groups from all subdirectory names. | |
| groups=$(find test -mindepth 1 -maxdepth 1 -type d \ | |
| | xargs -I{} basename {} | sort \ | |
| | jq -R -s -c '[split("\n")[] | select(length > 0)]') | |
| echo "groups=${groups}" >> "$GITHUB_OUTPUT" | |
| # Draft PR: only run ubuntu-latest + version=1 | |
| if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.draft }}" == "true" ]]; then | |
| echo 'version=["1"]' >> "$GITHUB_OUTPUT" | |
| echo 'os=["ubuntu-latest"]' >> "$GITHUB_OUTPUT" | |
| else | |
| echo 'version=["lts","1"]' >> "$GITHUB_OUTPUT" | |
| echo 'os=["ubuntu-latest","macOS-latest","windows-latest"]' >> "$GITHUB_OUTPUT" | |
| fi | |
| test: | |
| name: "Tests (${{ matrix.group }}, ${{ matrix.os }}, Julia ${{ matrix.version }})" | |
| needs: setup-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup-matrix.outputs.version) }} | |
| os: ${{ fromJSON(needs.setup-matrix.outputs.os) }} | |
| group: ${{ fromJSON(needs.setup-matrix.outputs.groups) }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 120 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.version }} | |
| - uses: julia-actions/cache@v3 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - uses: julia-actions/julia-runtest@v1 | |
| with: | |
| test_args: '${{ matrix.group }}${{ github.event.pull_request.draft == true && '' --fast'' || '''' }}' | |
| env: | |
| JULIA_NUM_THREADS: "4" | |
| - uses: julia-actions/julia-processcoverage@v1 | |
| with: | |
| directories: 'src,ext' | |
| - uses: codecov/codecov-action@v6 | |
| with: | |
| files: lcov.info | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| # test-nightly: | |
| # name: "Tests (${{ matrix.group }}, ${{ matrix.os }}, Julia nightly)" | |
| # needs: [setup-matrix, test] | |
| # if: github.event.pull_request.draft != true | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # version: | |
| # - 'nightly' | |
| # group: ${{ fromJSON(needs.setup-matrix.outputs.groups) }} | |
| # os: | |
| # - ubuntu-latest | |
| # - macOS-latest | |
| # - windows-latest | |
| # runs-on: ${{ matrix.os }} | |
| # timeout-minutes: 120 | |
| # steps: | |
| # - uses: actions/checkout@v6 | |
| # - uses: julia-actions/setup-julia@v2 | |
| # with: | |
| # version: ${{ matrix.version }} | |
| # - uses: julia-actions/cache@v3 | |
| # - uses: julia-actions/julia-buildpkg@v1 | |
| # - uses: julia-actions/julia-runtest@v1 | |
| # with: | |
| # test_args: '${{ matrix.group }}' |