fix:get correct z key #280
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: Tests | |
# 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. | |
on: | |
push: | |
tags-ignore: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'master' | |
jobs: | |
tests: | |
if: "!contains(github.event.pull_request.labels.*.name, 'auto-pr')" | |
env: | |
ENV_NAME: tests | |
PYTHON: ${{ matrix.python-version }} | |
OS: ${{ matrix.os }} | |
name: Testing | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: [3.8, 3.9, "3.10"] | |
defaults: | |
run: | |
# Adding -l {0} ensures conda can be found properly in each step | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
- name: Cache conda | |
uses: actions/cache@v2 | |
env: | |
# Increase this value to reset cache if ci/tests.yaml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}-${{ hashFiles('ci/tests.yaml', 'setup.cfg') }} | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2.1.1 | |
with: | |
# auto-update-conda: true | |
miniconda-version: "latest" | |
python-version: ${{ matrix.python-version }} | |
environment-file: ci/test-env.yml | |
activate-environment: tests | |
channel-priority: strict | |
use-only-tar-bz2: true | |
- name: Conda Info | |
run: | | |
conda info -a | |
conda list | |
PYVER=`python -c "import sys; print('{:d}.{:d}'.format(sys.version_info.major, sys.version_info.minor))"` | |
if [[ $PYVER != $PYTHON ]]; then | |
exit 1; | |
fi | |
# - name: Get C Libraries Linux | |
# if: matrix.os == 'ubuntu-latest' | |
# run: | | |
# sudo apt-get install libfftw3-dev | |
# sudo apt-get install libgsl0-dev | |
# - name: Install Dependencies MacOSX | |
# if: matrix.os == 'macos-latest' | |
# run: | | |
# export PATH="$HOME/miniconda/bin:$PATH" | |
# source activate ${ENV_NAME} | |
# conda env update -f ci/test-env.yml | |
# CC=gcc CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" pip install git+https://github.com/21cmFAST/21cmFAST.git | |
- name: Install 21CMMC | |
# if: matrix.os == 'ubuntu-latest' | |
run: | | |
echo $(which pip) | |
pip install . | |
# - name: Install 21CMMC MacOS | |
# if: matrix.os == 'macos-latest' | |
# run: | | |
# export PATH="$HOME/miniconda/bin:$PATH" | |
# source activate $ENV_NAME | |
# CC=gcc CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" pip install . | |
- name: List Environment | |
run: | | |
conda list | |
- name: Run Tests | |
run: | | |
python -m pytest --cov=py21cmmc --cov-config=.coveragerc -vv --cov-report xml:./coverage.xml --durations=25 | |
- uses: codecov/codecov-action@v2 | |
if: matrix.os == 'ubuntu-latest' && success() | |
with: | |
file: ./coverage.xml #optional | |
fail_ci_if_error: true |