|
| 1 | +name: CompatCheck |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'main' |
| 7 | + - 'release-' |
| 8 | + |
| 9 | + tags: '*' |
| 10 | + |
| 11 | + paths: |
| 12 | + - 'Project.toml' |
| 13 | + - 'test/Project.toml' |
| 14 | + |
| 15 | + pull_request: |
| 16 | + types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 21 | + # Cancel intermediate builds: only if it is a pull request build. |
| 22 | + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} |
| 23 | + |
| 24 | +jobs: |
| 25 | + setup-matrix: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + outputs: |
| 28 | + groups: ${{ steps.mk.outputs.groups }} |
| 29 | + version: ${{ steps.mk.outputs.version }} |
| 30 | + os: ${{ steps.mk.outputs.os }} |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v6 |
| 33 | + - id: mk |
| 34 | + shell: bash |
| 35 | + run: | |
| 36 | + # Auto-discover test groups from all subdirectory names. |
| 37 | + groups=$(find test -mindepth 1 -maxdepth 1 -type d \ |
| 38 | + | xargs -I{} basename {} | sort \ |
| 39 | + | jq -R -s -c '[split("\n")[] | select(length > 0)]') |
| 40 | +
|
| 41 | + echo "groups=${groups}" >> "$GITHUB_OUTPUT" |
| 42 | + fi |
| 43 | + compatcheck: |
| 44 | + name: "Compat (${{ matrix.group }}, Julia ${{ matrix.julia-version }})" |
| 45 | + needs: [setup-matrix, test] |
| 46 | + if: github.event.pull_request.draft != true |
| 47 | + runs-on: ubuntu-latest |
| 48 | + strategy: |
| 49 | + fail-fast: false |
| 50 | + matrix: |
| 51 | + downgrade_mode: ['deps'] |
| 52 | + group: ${{ fromJSON(needs.setup-matrix.outputs.groups) }} |
| 53 | + julia-version: ['1', '1.10'] |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v6 |
| 56 | + - uses: julia-actions/setup-julia@v2 |
| 57 | + with: |
| 58 | + version: ${{ matrix.julia-version }} |
| 59 | + - uses: julia-actions/cache@v3 |
| 60 | + - uses: julia-actions/julia-downgrade-compat@v2 |
| 61 | + with: |
| 62 | + mode: ${{ matrix.downgrade_mode }} |
| 63 | + skip: Random, LinearAlgebra, Test, Combinatorics |
| 64 | + julia_version: ${{ matrix.julia-version }} |
| 65 | + - uses: julia-actions/julia-buildpkg@v1 |
| 66 | + - uses: julia-actions/julia-runtest@v1 |
| 67 | + with: |
| 68 | + test_args: '${{ matrix.group }} --fast' |
| 69 | + env: |
| 70 | + JULIA_NUM_THREADS: "4" |
0 commit comments