CI: Add Apple Silicon (macOS aarch64) to the CI matrix #1261
Workflow file for this run
This file contains 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: | |
pull_request: | |
push: | |
branches: | |
- 'main' | |
- 'release-*' | |
tags: '*' | |
concurrency: | |
# Skip intermediate builds: all builds except for builds on the `main` or `release-*` branches | |
# Cancel intermediate builds: only pull request builds | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }} | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 90 | |
strategy: | |
fail-fast: false | |
matrix: | |
julia-version: | |
- 'nightly' | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-12 # Intel | |
- macos-13 # Intel | |
- macos-14 # Apple Silicon | |
julia-word-size: | |
- '32' | |
- '64' | |
exclude: | |
- os: macos-12 | |
julia-word-size: '32' | |
- os: macos-13 | |
julia-word-size: '32' | |
- os: macos-14 | |
julia-word-size: '32' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Determine the value of JULIA_ARCH | |
id: determine-julia-arch | |
shell: bash | |
env: | |
JULIA_WORD_SIZE: ${{ matrix.julia-word-size }} | |
run: | | |
echo "RUNNER_ARCH is: ${RUNNER_ARCH:?}" | |
echo "JULIA_WORD_SIZE is: ${JULIA_WORD_SIZE:?}" | |
if [[ "${JULIA_WORD_SIZE:?}" == "32" ]]; then | |
# If JULIA_WORD_SIZE is 32, then we hard-code JULIA_ARCH | |
# to be x86, because x86 is the only 32-bit arch that we | |
# test. | |
echo "julia-arch=x86" >> "${GITHUB_OUTPUT:?}" | |
elif [[ "$JULIA_WORD_SIZE" == "64" ]]; then | |
# If JULIA_WORD_SIZE is 64, then we set JULIA_ARCH to be | |
# the same as RUNNER_ARCH. | |
# | |
# Note: RUNNER_ARCH is an environment variable that is | |
# automatically set by GitHub Actions. | |
echo "julia-arch=${RUNNER_ARCH:?}" >> "${GITHUB_OUTPUT:?}" | |
else | |
echo "Invalid value for JULIA_WORD_SIZE: ${JULIA_WORD_SIZE:?}" | |
exit 1 | |
fi | |
- run: echo JULIA_ARCH is "${JULIA_ARCH:?}" | |
shell: bash | |
env: | |
JULIA_ARCH: ${{ steps.determine-julia-arch.outputs.julia-arch }} | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: ${{ matrix.julia-version }} | |
arch: ${{ steps.determine-julia-arch.outputs.julia-arch }} | |
- uses: actions/cache@v4 | |
env: | |
cache-name: cache-artifacts | |
with: | |
path: ~/.julia/artifacts | |
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | |
restore-keys: | | |
${{ runner.os }}-test-${{ env.cache-name }}- | |
${{ runner.os }}-test-${{ matrix.os }} | |
${{ runner.os }}- | |
- run: julia --color=yes .ci/test_and_change_uuid.jl | |
- uses: julia-actions/julia-buildpkg@v1 | |
- uses: julia-actions/julia-runtest@v1 | |
env: | |
SPARSEARRAYS_AQUA_TEST: true | |
- uses: julia-actions/julia-processcoverage@v1 | |
- uses: codecov/codecov-action@v4 | |
with: | |
file: lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@latest | |
with: | |
# version: '1.6' | |
version: 'nightly' | |
- name: Generate docs | |
run: | | |
julia --color=yes -e 'write("Project.toml", replace(read("Project.toml", String), r"uuid = .*?\n" =>"uuid = \"3f01184e-e22b-5df5-ae63-d93ebab69eaf\"\n"));' | |
julia --project --color=yes -e 'using Pkg; Pkg.activate("docs"); Pkg.instantiate(); Pkg.develop(PackageSpec(path = pwd()))' | |
julia --project=docs --color=yes docs/make.jl pdf | |
env: | |
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} |