Skip to content

antarcticrainforest is testing the code #890

antarcticrainforest is testing the code

antarcticrainforest is testing the code #890

Workflow file for this run

name: CI Tests
run-name: ${{ github.actor }} is testing the code
# Set the access for individual scopes, or use permissions: write-all
permissions:
pull-requests: write
on:
push:
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
-
name: Ceckout
uses: actions/checkout@v4
-
name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
-
name: Install packages
run: |
python3 -m pip install -e .[test]
-
name: Linting
run: make lint
test:
runs-on: ubuntu-latest
env:
NUMEXPR_MAX_THREADS: 8
GIT_SUBMODULE_STRATEGY: recursive
strategy:
max-parallel: 5
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
steps:
-
name: Ceckout
uses: actions/checkout@v4
with:
submodules: recursive
-
name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{matrix.python-version}}
-
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: Set up services
run: |
docker-compose up -d --remove-orphans
-
name: Install dependencies on python ${{matrix.python-version}}
run: |
python3 -m pip install -e .[test]
-
name: Running tests for python ${{ matrix.python-version }}
run: |
make test_coverage
-
name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
docs:
runs-on: ubuntu-latest
permissions:
contents: write
env:
NUMEXPR_MAX_THREADS: 8
GIT_SUBMODULE_STRATEGY: recursive
DJANGO_ALLOW_ASYNC_UNSAFE: 1
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
-
name: Set up Python
uses: actions/setup-python@v3
-
name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
-
name: Install freva
run: |
conda create -c conda-forge -n docs -y -q freva cartopy make
-
name: Set up services
run: |
docker-compose up -d --remove-orphans
-
name: Preparing docs
run: |
conda run -n docs make prepdocs
-
name: Creating docs
run: |
conda run -n docs make docs
-
name: Setup Pages
uses: actions/configure-pages@v2
if: ${{ github.ref == 'refs/heads/main' }}
-
name: Upload artifact
uses: actions/upload-pages-artifact@v1
if: ${{ github.ref == 'refs/heads/main' }}
with:
# Upload entire repository
path: './docs/build/html'
-
name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
dependabot:
name: Merge PR by dependabot
runs-on: ubuntu-latest
needs: [docs, test, 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]'
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}}