fix(ci): MIN_PYTHON_VERSION 3.10 -> '3.10' #92
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: CI | |
# Enable Buildkit and let compose use it to speed up image building | |
env: | |
DOCKER_BUILDKIT: 1 | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
CONDA_ENV_NAME: clim-recal | |
CONDA_ENV_PATH: environment.yml | |
MIN_PYTHON_VERSION: "3.10" | |
PYTHON_MODULE_FOLDER: python/ | |
COVERAGE_SVG_FOLDER: docs/assets/ | |
COVERAGE_SVG_FILE_NAME: coverage.svg | |
# replace below with references to previous config lines | |
COVERAGE_SVG_PATH: docs/assets/coverage.svg | |
GH_PAGE_PATH: _gh-page | |
on: | |
pull_request: | |
branches: ['main', 'fix-quartodoc'] | |
paths-ignore: ['docs/**'] | |
push: | |
branches: ['main', 'fix-quartodoc'] | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
linter: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code Repository | |
uses: actions/checkout@main | |
- name: Set up Python | |
uses: actions/setup-python@main | |
with: | |
python-version: ${{ env.MIN_PYTHON_VERSION }} | |
- name: Run pre-commit | |
uses: pre-commit/action@main | |
- name: Update pre-commit | |
uses: pre-commit-ci/lite-action@main | |
if: always() | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code Repository | |
uses: actions/checkout@main | |
- name: Build Conda Environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: ${{ env.CONDA_ENV_NAME }} | |
environment-file: ${{ env.CONDA_ENV_PATH }} | |
auto-activate-base: false | |
miniforge-version: latest | |
- name: Test and Save Test Coverage | |
shell: bash -el {0} | |
run: | | |
mamba run -n ${{ env.CONDA_ENV_NAME }} --cwd python pytest | |
- name: Copy test coverage results | |
run: | | |
cp ${{ env.PYTHON_MODULE_FOLDER }}${{ env.COVERAGE_SVG_PATH }} ${{ env.COVERAGE_SVG_FOLDER }} | |
- name: Archive coverage svg | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-badge | |
path: ${{ env.COVERAGE_SVG_PATH }} | |
docs: | |
needs: [linter, pytest] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download coverage svg | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-badge | |
path: ${{ env.GH_PAGE_PATH }}${{ env.COVERAGE_SVG_PATH }} | |
- name: Build Conda Environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: ${{ env.CONDA_ENV_NAME }} | |
environment-file: ${{ env.CONDA_ENV_PATH }} | |
auto-activate-base: false | |
miniforge-version: latest | |
- name: Run `quartodoc` | |
shell: bash -el {0} | |
run: | | |
mamba run -n ${{ env.CONDA_ENV_NAME }} quartodoc build |