Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #37

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #37

name: JAX-UniRep CI pipeline
on: [pull_request]
jobs:
# Code style checks
# In principle, these don't rely on the environment.yml,
# and can be run in a bare native Python env instead.
# Doing so gives us speed, so we can quickly uncover code style issues
# instead of having to wait for the environment to be built first.
code-style:
runs-on: ubuntu-18.04
name: Code style checks
steps:
- uses: actions/checkout@v2
name: Checkout repository
- uses: actions/setup-python@v2
name: Setup Python
with:
python-version: 3.9
- name: Install code style checker "black"
run: python -m pip install black
- name: Run black
run: make style
# Build environment
# This can be zipped up and passed to the downstream jobs:
# - run-tests
# - make-docs
# for which we want both to run concurrently to save time.
build-environment:
runs-on: ubuntu-18.04
name: Build conda environment
steps:
- uses: actions/checkout@v2
name: Checkout repository
# See: https://github.com/marketplace/actions/setup-conda
- uses: s-weigand/setup-conda@v1
with:
conda-channels: "conda-forge"
# Build cache of environment -- this can shave minutes off the CI.
- name: Cache conda environment
id: cache-environment
uses: actions/cache@v2
# Conda environment build step depends on just environment.yml,
# so we ensure that the hash key contains its hash.
# If the file changes, then its hash will change,
# and the cache will be invalidated,
# thus triggering a rebuild.
# (There is a strong assumption here that changing `build_environment.sh`
# will not change the environment definition, which it shouldn't.)
with:
path: |
jax-unirep.tar.gz
key: ${{ runner.os }}-${{ hashFiles('environment.yml') }}
- name: Build and pack environment
if: steps.cache-environment.outputs.cache-hit != 'true'
run: bash scripts/ci/build_environment.sh
# See: https://github.com/actions/upload-artifact
- name: Upload environment
uses: actions/upload-artifact@v2
with:
name: jax-unirep-tarball
path: jax-unirep.tar.gz
run-fast-tests:
runs-on: ubuntu-18.04
needs: build-environment
name: Run fast tests
steps:
- uses: actions/checkout@v2
name: Checkout repository
# https://github.com/actions/download-artifact
- name: Download environment tarball
uses: actions/[email protected]
with:
name: jax-unirep-tarball
- name: Unpack environment and activate it
run: bash scripts/ci/unpack_environment.sh
- name: Run fast tests
run: |
source /tmp/jax_unirep_env/bin/activate
make fasttest
bash <(curl -s https://codecov.io/bash) -cF python
# - name: Upload fast-test coverage
# uses: codecov/codecov-action@v1
# with:
# files: ./.coverage
# name: codecov-fast-tests
# fail_ci_if_error: true
run-slow-tests:
runs-on: ubuntu-18.04
needs: build-environment
name: Run slow tests
steps:
- uses: actions/checkout@v2
name: Checkout repository
# https://github.com/actions/download-artifact
- name: Download environment tarball
uses: actions/[email protected]
with:
name: jax-unirep-tarball
- name: Unpack environment and activate it
run: bash scripts/ci/unpack_environment.sh
- name: Run slow tests
run: |
source /tmp/jax_unirep_env/bin/activate
make slowtest
bash <(curl -s https://codecov.io/bash) -cF python
# - name: Upload slow-test coverage
# uses: codecov/codecov-action@v1
# with:
# files: ./.coverage
# name: codecov-slow-tests
# fail_ci_if_error: true
build-docs:
runs-on: ubuntu-18.04
needs: build-environment
name: Build docs
steps:
- uses: actions/checkout@v2
name: Checkout repository
# https://github.com/actions/download-artifact
- name: Download environment tarball
uses: actions/[email protected]
with:
name: jax-unirep-tarball
- name: Unpack environment and activate it
run: bash scripts/ci/unpack_environment.sh
- name: Build Docs
run: |
source /tmp/jax_unirep_env/bin/activate
bash scripts/ci/build_docs.sh