Fixing mac build and clang compilation on v4-prep #32
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: Test MacOS Build | |
# Test on all pushes, except when the push is literally just a tag (because we | |
# tag automatically via CI, and therefore there's no extra code in that push). | |
# Also, only test on pull requests into master/production. | |
on: | |
push: | |
tags-ignore: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'master' | |
- 'production' | |
- 'v4-prep' | |
jobs: | |
tests: | |
if: "!contains(github.event.pull_request.labels.*.name, 'auto-pr')" | |
env: | |
PYTHON: ${{ matrix.python-version }} | |
CC: gcc | |
name: Testing | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-14, macos-13] # macos-14 is arm64, macos-13 is not. | |
python-version: ["3.11"] | |
compiler: ["gcc", "clang"] | |
defaults: | |
run: | |
# Adding -l {0} ensures conda can be found properly in each step | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@master | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Print head git commit message | |
id: get_head_commit_message | |
run: echo "commit_message=$(git show -s --format=%s)" >> "$GITHUB_ENV" | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
# auto-update-conda: true | |
mamba-version: "*" | |
channels: conda-forge,defaults | |
python-version: ${{ matrix.python-version }} | |
environment-file: ci/macos-latest-env.yml | |
activate-environment: tests | |
channel-priority: true | |
- name: Conda Info | |
run: | | |
conda info -a | |
conda list | |
conda config --show-sources | |
conda config --show | |
printenv | sort | |
- name: Setup GCC | |
if: matrix.compiler == 'gcc' | |
uses: Dup4/actions-setup-gcc@v1 | |
with: | |
version: latest | |
- name: Install 21cmFAST | |
run: | | |
CC=${{ matrix.compiler }} CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" pip install . | |
- name: Test Import | |
run: | | |
python -c "import py21cmfast" |