|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + tags: ['*'] |
| 8 | + paths-ignore: |
| 9 | + - 'CITATION.bib' |
| 10 | + - 'LICENSE.md' |
| 11 | + - 'README.md' |
| 12 | + - '.zenodo.json' |
| 13 | + - '.github/workflows/CompatHelper.yml' |
| 14 | + - '.github/workflows/SpellCheck.yml' |
| 15 | + - '.github/workflows/TagBot.yml' |
| 16 | + - 'docs/**' |
| 17 | + pull_request: |
| 18 | + paths-ignore: |
| 19 | + - 'CITATION.bib' |
| 20 | + - 'LICENSE.md' |
| 21 | + - 'README.md' |
| 22 | + - '.zenodo.json' |
| 23 | + - '.github/workflows/CompatHelper.yml' |
| 24 | + - '.github/workflows/SpellCheck.yml' |
| 25 | + - '.github/workflows/TagBot.yml' |
| 26 | + - 'docs/**' |
| 27 | + workflow_dispatch: |
| 28 | + |
| 29 | +concurrency: |
| 30 | + # Skip intermediate builds: always. |
| 31 | + # Cancel intermediate builds: only if it is a pull request build. |
| 32 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 33 | + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} |
| 34 | + |
| 35 | +jobs: |
| 36 | + build: |
| 37 | + name: Run Tests (Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}) |
| 38 | + runs-on: ubuntu-latest |
| 39 | + strategy: |
| 40 | + # Don't cancel all running jobs when one job fails |
| 41 | + fail-fast: false |
| 42 | + matrix: |
| 43 | + version: |
| 44 | + - '1.9' |
| 45 | + - '1' |
| 46 | + os: |
| 47 | + - ubuntu-latest |
| 48 | + arch: |
| 49 | + - x64 |
| 50 | + include: |
| 51 | + # Also run tests on Windows and macOS-ARM, but only with the latest Julia version |
| 52 | + - version: '1' |
| 53 | + os: windows-latest |
| 54 | + arch: x64 |
| 55 | + - version: '1' |
| 56 | + os: macos-14 |
| 57 | + arch: arm64 |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: Check out project |
| 61 | + uses: actions/checkout@v4 |
| 62 | + - name: Set up Julia |
| 63 | + uses: julia-actions/setup-julia@v2 |
| 64 | + with: |
| 65 | + version: ${{ matrix.version }} |
| 66 | + - run: julia -e 'using InteractiveUtils; versioninfo(verbose=true)' |
| 67 | + - uses: julia-actions/cache@v1 |
| 68 | + - name: Build package |
| 69 | + uses: julia-actions/julia-buildpkg@v1 |
| 70 | + - name: Run tests |
| 71 | + uses: julia-actions/julia-runtest@v1 |
| 72 | + with: |
| 73 | + annotate: true |
| 74 | + # Only run coverage in one Job (Ubuntu and latest Julia version) |
| 75 | + coverage: ${{ matrix.os == 'ubuntu-latest' && matrix.version == '1' }} |
| 76 | + - name: Process coverage results |
| 77 | + # Only run coverage in one Job (Ubuntu and latest Julia version) |
| 78 | + if: matrix.os == 'ubuntu-latest' && matrix.version == '1' |
| 79 | + uses: julia-actions/julia-processcoverage@v1 |
| 80 | + with: |
| 81 | + directories: src,test |
| 82 | + - name: Upload coverage report to Codecov |
| 83 | + # Only run coverage in one Job (Ubuntu and latest Julia version) |
| 84 | + if: matrix.os == 'ubuntu-latest' && matrix.version == '1' |
| 85 | + uses: codecov/codecov-action@v4 |
| 86 | + with: |
| 87 | + files: lcov.info |
| 88 | + fail_ci_if_error: true |
| 89 | + flags: unit |
| 90 | + env: |
| 91 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments