antarcticrainforest is testing the code #238
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 | |
run-name: ${{ github.actor }} is testing the code | |
# Set the access for individual scopes, or use permissions: write-all | |
permissions: | |
pull-requests: write | |
repository-projects: write | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: lint and style checks | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Add conda to system path | |
run: | | |
# $CONDA is an environment variable pointing to the root of the miniconda directory | |
echo $CONDA/bin >> $GITHUB_PATH | |
- name: Creating conda environment for python 3.12 | |
run: | | |
conda create -n test -c conda-forge -y python=${{matrix.python-version}} ffmpeg pip cartopy make hdf5 pandoc tox | |
- name: Install dependencies | |
run: | | |
conda run -n test python3 -m pip install -U -e .[tests] | |
- name: Setup jupyter kernel | |
run: | | |
conda run -n test python3 -m ipykernel install --name tintx --display-name "tintX kernel" --env DATA_FILES ${PWD}/docs/source/_static/data --user | |
conda run -n test python3 -m bash_kernel.install | |
- name: Linting the code | |
env: | |
DATA_FILES: ./docs/source/_static/data | |
run: | | |
conda run -n test tox -p -e lint,docs | |
tests: | |
name: tintX tests | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Add conda to system path | |
run: | | |
# $CONDA is an environment variable pointing to the root of the miniconda directory | |
echo $CONDA/bin >> $GITHUB_PATH | |
- name: Creating conda environment for python ${{ matrix.python-version }} | |
run: | | |
conda create -n test -c conda-forge -y python=${{matrix.python-version}} ffmpeg pip cartopy make hdf5 pandoc tox | |
- name: Install dependencies | |
run: | | |
conda run -n test python3 -m pip install -U -e .[tests] | |
- name: Setup jupyter kernel | |
run: | | |
conda run -n test python3 -m ipykernel install --name tintx --display-name "tintX kernel" --env DATA_FILES ${PWD}/docs/source/_static/data --user | |
conda run -n test python3 -m bash_kernel.install | |
- name: Test with pytest | |
env: | |
DATA_FILES: ./docs/source/_static/data | |
run: | | |
conda run -n test tox -e tests | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./report.xml | |
verbose: true | |
dependabot: | |
name: Merge PR by dependabot | |
runs-on: ubuntu-latest | |
needs: [tests, lint] | |
# Specifically check that dependabot (or another trusted party) created this pull-request, and that it has been labelled correctly. | |
if: github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'dependencies') | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/fetch-metadata@v1 | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Approve dependabot's PR | |
run: gh pr review --approve "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.TOKEN}} | |
- name: Auto-merge for dependabot's PR | |
run: gh pr merge --merge --auto "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.TOKEN}} |