Skip to content

antarcticrainforest is testing the code #236

antarcticrainforest is testing the code

antarcticrainforest is testing the code #236

Workflow file for this run

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=3.12 pip cartopy make
- name: Install dependencies
run: |
conda run -n test python3 -m pip install -U -e .[dev]
- name: Linting the code
run: |
conda run -n test tox -e lint
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
- name: Install dependencies
run: |
conda run -n test python3 -m pip install -U -e .[dev]
- 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 -p -e tests,docs
- 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}}