|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - 'master' |
| 8 | + - 'release-*' |
| 9 | + tags: '*' |
| 10 | + merge_group: # GitHub Merge Queue |
| 11 | + |
| 12 | +concurrency: |
| 13 | + # Skip intermediate builds: all builds except for builds on the `master` branch |
| 14 | + # Cancel intermediate builds: only pull request builds |
| 15 | + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} |
| 16 | + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} |
| 17 | + |
| 18 | +jobs: |
| 19 | + finalize: |
| 20 | + if: always() # this line is important to keep the `finalize` job from being marked as skipped; do not change or delete this line |
| 21 | + runs-on: ubuntu-latest |
| 22 | + timeout-minutes: 10 |
| 23 | + needs: |
| 24 | + - ci_started |
| 25 | + - test |
| 26 | + - docs |
| 27 | + - build-mylib |
| 28 | + steps: |
| 29 | + - run: | |
| 30 | + echo ci_started: ${{ needs.ci_started.result }} |
| 31 | + echo test: ${{ needs.test.result }} |
| 32 | + echo docs: ${{ needs.docs.result }} |
| 33 | + echo build-mylib: ${{ needs.build-mylib.result }} |
| 34 | + - run: exit 1 |
| 35 | + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} |
| 36 | + ci_started: |
| 37 | + runs-on: ubuntu-latest |
| 38 | + timeout-minutes: 10 |
| 39 | + steps: |
| 40 | + - run: exit 0 |
| 41 | + test: |
| 42 | + timeout-minutes: 90 |
| 43 | + runs-on: ${{ matrix.github-runner }} |
| 44 | + strategy: |
| 45 | + max-parallel: 20 # leave space for other runs in the JuliaLang org, given these tests are long |
| 46 | + fail-fast: false |
| 47 | + matrix: |
| 48 | + julia-version: |
| 49 | + - '1.6' # previous LTS |
| 50 | + # - '1.9' # TODO: uncomment this line once we fix the tests on 1.9 |
| 51 | + - '1.10' # current LTS |
| 52 | + - '1.11' |
| 53 | + # - 'nightly' # TODO: decide whether we want to run any CI jobs on nightly. |
| 54 | + julia-wordsize: |
| 55 | + # The value here only affects the version of Julia binary that we download. |
| 56 | + # It does not affect the architecture of the GitHub Runner (virtual machine) that |
| 57 | + # we run on. |
| 58 | + - '32' # 32-bit Julia. Only available on x86_64. Not available on aarch64. |
| 59 | + - '64' # 64-bit Julia. |
| 60 | + github-runner: |
| 61 | + - ubuntu-latest |
| 62 | + - windows-latest |
| 63 | + - macos-13 # macos-13 = Intel. |
| 64 | + - macos-14 # macos-14 = Apple Silicon. |
| 65 | + coverage: |
| 66 | + - 'true' |
| 67 | + - 'false' # needed for Julia 1.9+ to test from a session using pkgimages |
| 68 | + exclude: |
| 69 | + # For now, we'll disable testing 32-bit Julia 1.9 on Windows. |
| 70 | + # TODO: remove the following once we fix the tests for 32-bit Julia 1.9 on Windows. |
| 71 | + - github-runner: windows-latest |
| 72 | + julia-version: '1.9' |
| 73 | + julia-wordsize: '32' |
| 74 | + # |
| 75 | + # Julia 1.6 did not support Apple Silicon: |
| 76 | + - github-runner: macos-14 # macos-14 = Apple Silicon. |
| 77 | + julia-version: '1.6' |
| 78 | + # |
| 79 | + # We don't have 32-bit builds of Julia for Intel macOS: |
| 80 | + - github-runner: macos-13 # macos-13 = Intel. |
| 81 | + julia-wordsize: '32' |
| 82 | + # |
| 83 | + # We don't have 32-bit builds of Julia for Apple Silicon macOS: |
| 84 | + - github-runner: macos-14 # macos-14 = Apple Silicon. |
| 85 | + julia-wordsize: '32' |
| 86 | + # |
| 87 | + # We don't need to run the coverage=false job for Julia < 1.9: |
| 88 | + - julia-version: '1.6' |
| 89 | + coverage: 'false' |
| 90 | + - julia-version: '1.7' |
| 91 | + coverage: 'false' |
| 92 | + - julia-version: '1.8' |
| 93 | + coverage: 'false' |
| 94 | + steps: |
| 95 | + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 |
| 96 | + - uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 |
| 97 | + with: |
| 98 | + version: ${{ matrix.julia-version }} |
| 99 | + # If `julia-wordsize` is 32, then we set `arch` to `x86`, because we know that |
| 100 | + # 32-bit builds of Julia are only available for x86. |
| 101 | + # |
| 102 | + # If `julia-wordsize` is 64, then we set `arch` to `${{ runner.arch }}`, which |
| 103 | + # GitHub will automatically expand to the correct value (`x86_64` or `aarch64`) |
| 104 | + # based on the architecture of the underlying GitHub Runner (virtual machine). |
| 105 | + arch: ${{ github.ref == '32' && 'x86' || runner.arch }} |
| 106 | + - uses: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834 # v2.0.5 |
| 107 | + - uses: julia-actions/julia-runtest@d0c4f093badade621cd041bba567d1e832480ac2 # v1.10.0 |
| 108 | + with: |
| 109 | + coverage: ${{ matrix.coverage }} |
| 110 | + - uses: julia-actions/julia-processcoverage@03114f09f119417c3242a9fb6e0b722676aedf38 # v1.2.2 |
| 111 | + - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 |
| 112 | + with: |
| 113 | + file: lcov.info |
| 114 | + env: |
| 115 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 116 | + docs: |
| 117 | + runs-on: ubuntu-latest |
| 118 | + timeout-minutes: 30 |
| 119 | + steps: |
| 120 | + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 |
| 121 | + - uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 |
| 122 | + with: |
| 123 | + version: '1' |
| 124 | + - name: Build and deploy docs |
| 125 | + env: |
| 126 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token |
| 127 | + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key |
| 128 | + run: julia --project=docs/ -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")' |
| 129 | + build-mylib: |
| 130 | + runs-on: ubuntu-latest |
| 131 | + timeout-minutes: 60 |
| 132 | + steps: |
| 133 | + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 |
| 134 | + - uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 |
| 135 | + with: |
| 136 | + version: '1' |
| 137 | + - uses: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834 # v2.0.5 |
| 138 | + - uses: julia-actions/julia-buildpkg@90dd6f23eb49626e4e6612cb9d64d456f86e6a1c # v1.6.0 |
| 139 | + with: |
| 140 | + project: 'examples/MyLib' |
| 141 | + - uses: julia-actions/julia-buildpkg@90dd6f23eb49626e4e6612cb9d64d456f86e6a1c # v1.6.0 |
| 142 | + with: |
| 143 | + project: 'examples/MyLib/build' |
| 144 | + - run: | |
| 145 | + cd examples/MyLib |
| 146 | + make |
| 147 | + - run: ./examples/MyLib/my_application.out |
| 148 | + env: |
| 149 | + LD_LIBRARY_PATH: 'examples/MyLib/MyLibCompiled/lib' |
0 commit comments