Skip to content

Commit

Permalink
Merge branch 'test' of github.com:ESadek-MO/iris-esmf-regrid into test
Browse files Browse the repository at this point in the history
  • Loading branch information
ESadek-MO committed Aug 8, 2023
2 parents f63a848 + cc9d1b9 commit 65b80e6
Show file tree
Hide file tree
Showing 26 changed files with 1,165 additions and 675 deletions.
151 changes: 0 additions & 151 deletions .cirrus.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# reference:
# - https://github.com/actions/cache
# - https://github.com/actions/checkout

name: benchmark-check

on:
pull_request:

push:
branches:
- "main"
- "v*x"
- "!auto-update-lockfiles"
- "!pre-commit-ci-update-config"
- "!dependabot/*"
tags:
- "v*"

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
benchmark:
name: "performance benchmarks (py${{ matrix.python-version }})"

runs-on: ubuntu-latest

env:
PY_VER: "3.10"
IRIS_TEST_DATA_LOC_PATH: benchmarks
IRIS_TEST_DATA_PATH: benchmarks/iris-test-data
IRIS_TEST_DATA_VERSION: "2.19"
#: If you change the IRIS_SOURCE here you will also need to change it in
#: the noxfile and the tests and wheel workflows.
IRIS_SOURCE: "github:main"
ENV_CACHE_BUILD: "0"
TEST_DATA_CACHE_BUILD: "0"

strategy:
matrix:
python-version: ["3.10"]

steps:
- name: "checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- if: ${{ github.event_name == 'pull_request' }}
# TODO: remove this, so we can benchmark using GHA's default
# commit - a simulated merge. Requires adapting
# --session="benchmarks(branch)" to accept inputs for both
# commits to compare (instead of deriving one of them).
# Currently, this checks out the HEAD of the pull request.
run: git checkout HEAD^2

- name: Install ASV & Nox
run: |
pip install asv nox
- name: Cache environment directories
uses: actions/cache@v3
with:
path: |
.nox
benchmarks/.asv/env
$CONDA/pkgs
key: ${{ runner.os }}-${{ hashFiles('requirements/') }}-${{ env.ENV_CACHE_BUILD }}-${{ env.IRIS_SOURCE }}

- name: Benchmark script
run: |
if ${{ github.event_name != 'pull_request' }}; then export COMPARE="HEAD~"; else export COMPARE="origin/${{ github.base_ref }}"; fi;
nox --session=tests --install-only
export DATA_GEN_PYTHON=$(realpath $(find .nox -path "*tests/bin/python"))
nox --session="benchmarks(branch)" -- "${COMPARE}"
- name: Archive ASV results
uses: actions/upload-artifact@v3
with:
name: asv-report
path: |
benchmarks/.asv/results
99 changes: 99 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# reference:
# - https://github.com/actions/cache
# - https://github.com/actions/checkout

name: ci-tests

on:
pull_request:

push:
branches:
- "main"
- "v*x"
- "!auto-update-lockfiles"
- "!pre-commit-ci-update-config"
- "!dependabot/*"
tags:
- "v*"

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: "${{ matrix.session }} (py${{ matrix.python-version }} ${{ matrix.os }})"

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
#: If you change the IRIS_SOURCE here you will also need to change it in
#: the noxfile and the benchmark and wheel workflows.
IRIS_SOURCE: "github:main"
IRIS_TEST_DATA_LOC_PATH: tests
IRIS_TEST_DATA_PATH: tests/iris-test-data
IRIS_TEST_DATA_VERSION: "2.19"
ENV_CACHE_BUILD: "0"
TEST_DATA_CACHE_BUILD: "0"

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11"]
include:
- python-version: "3.10"
coverage: true

steps:
- name: "checkout"
uses: actions/checkout@v3

- name: Install Nox
run: |
pip install nox
- name: Cache environment directories
id: cache-env-dir
uses: actions/cache@v3
with:
path: |
.nox
$CONDA/pkgs
key: ${{ runner.os }}-${{ hashFiles('requirements/') }}-${{ env.ENV_CACHE_BUILD }}-${{ env.IRIS_SOURCE }}-${{ matrix.python-version }}

- name: Cache test data directory
id: cache-test-data
uses: actions/cache@v3
with:
path: |
${{ env.IRIS_TEST_DATA_PATH }}
key:
test-data-${{ env.IRIS_TEST_DATA_VERSION }}-${{ env.TEST_DATA_CACHE_BUILD }}

- name: Fetch the test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
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_LOC_PATH}
mv iris-test-data-${IRIS_TEST_DATA_VERSION} ${IRIS_TEST_DATA_PATH}
- name: Set test data var
run: |
echo "OVERRIDE_TEST_DATA_REPOSITORY=${{ github.workspace }}/${IRIS_TEST_DATA_PATH}/test_data" >> $GITHUB_ENV
- name: "tests (py${{ matrix.python-version }})"
env:
PY_VER: ${{ matrix.python-version }}
COVERAGE: ${{ matrix.coverage }}
run: |
nox --session tests -- --verbose
Loading

0 comments on commit 65b80e6

Please sign in to comment.