Add support for cloning configuration using a commit hash #454
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
# Run CI tests | |
name: CI | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
PY_VERSION: 3.11 | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
pypa-build: | |
name: PyPA build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PY_VERSION }} | |
cache: 'pip' # caching pip dependencies | |
- run: | | |
python3 -m pip install --upgrade build && python3 -m build | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./dist | |
conda-build: | |
name: Conda Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup conda environment | |
uses: conda-incubator/setup-miniconda@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1 | |
with: | |
miniconda-version: "latest" | |
python-version: ${{ env.PY_VERSION }} | |
environment-file: conda/environment.yml | |
auto-update-conda: false | |
auto-activate-base: false | |
show-channel-urls: true | |
- name: Run conda build | |
shell: bash -el {0} | |
run: conda build . --no-anaconda-upload | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
# Run the job for different versions of python | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out repository code | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: pip install -r test/requirements_test.txt | |
- name: Install payu | |
run: pip install . | |
- name: Check payu installed correctly | |
run: payu list | |
- name: Lint | |
run: pylint --extension-pkg-whitelist=netCDF4 --ignored-modules=backports -E payu | |
- name: Run tests | |
run: | | |
PYTHONPATH=. pytest --cov=payu -s test; | |
- name: Coveralls | |
uses: AndreMiras/coveralls-python-action@65c1672f0b8a201702d86c81b79187df74072505 | |
with: | |
parallel: true | |
- name: Make docs | |
run: cd docs && make html | |
coveralls_finish: | |
name: Coveralls Finished | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: AndreMiras/coveralls-python-action@65c1672f0b8a201702d86c81b79187df74072505 | |
with: | |
parallel-finished: true |