A neater way to add attrs #354
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
# A workflow to do PR test runs | |
# | |
# Reference: | |
# - https://github.com/actions/checkout | |
# - https://github.com/conda-incubator/setup-miniconda | |
name: ci-tests | |
# Triggers the workflow on pull-request or push events | |
on: [pull_request, push] | |
jobs: | |
tests: | |
name: "Test Python ${{ matrix.version }}" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
IRIS_TEST_DATA_VERSION: "2.20" | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: "Create conda environment" | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
activate-environment: testenv | |
python-version: ${{ matrix.version }} | |
channels: conda-forge | |
show-channel-urls: true | |
- name: "Install dependencies" | |
run: | | |
conda install --yes "numpy<2" pytest pytest-mock iris xarray filelock requests | |
- name: "Install *latest* Iris" | |
run: | | |
git clone https://github.com/SciTools/iris.git ./iris | |
cd iris | |
pip install -e . | |
cd .. | |
- name: "Install repo-under-test" | |
run: | | |
python -m pip install --no-deps --editable . | |
- name: "Conda info" | |
run: | | |
conda info | |
conda list --explicit | |
- name: "Fetch Iris-test-data" | |
run: | | |
wget --quiet https://github.com/SciTools/iris-test-data/archive/v${IRIS_TEST_DATA_VERSION}.zip -O iris-test-data.zip | |
unzip -q iris-test-data.zip | |
mkdir --parents ${GITHUB_WORKSPACE}/iris_test_data | |
mv iris-test-data-${IRIS_TEST_DATA_VERSION} ${GITHUB_WORKSPACE}/iris_test_data_download | |
- name: "Run tests" | |
run: | | |
ls ${GITHUB_WORKSPACE}/iris_test_data_download/test_data | |
OVERRIDE_TEST_DATA_REPOSITORY=${GITHUB_WORKSPACE}/iris_test_data_download/test_data PYTHONPATH=./tests:$PYTHONPATH pytest -v ./tests |