CI #444
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 | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' # Daily “At 00:00” | |
workflow_dispatch: # allows you to trigger manually | |
jobs: | |
build: | |
name: python-${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
include: | |
- python-version: 3.8 | |
environment-file: ci/environment.yaml | |
- python-version: 3.9 | |
environment-file: ci/environment.yaml | |
- python-version: 3.10 | |
environment-file: ci/environment.yaml | |
- python-version: 3.11 | |
environment-file: ci/environment.yaml | |
- python-version: 3.12 | |
environment-file: ci/environment.yaml | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags. | |
- name: Set environment variables | |
run: | | |
echo "CONDA_ENV_FILE=ci/environment.yaml" >> $GITHUB_ENV | |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
- name: Set up conda environment with micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ${{ matrix.environment-file }} | |
environment-name: esm_catalog_utils_ci | |
create-args: python=${{ matrix.python-version }} | |
- name: Install esm_catalog_utils | |
run: | | |
python -m pip install . --no-deps | |
conda list | |
- name: Code Checks | |
run: | | |
black --diff --check esm_catalog_utils tests | |
isort --diff esm_catalog_utils tests | |
flake8 esm_catalog_utils tests | |
mypy esm_catalog_utils tests | |
- name: Run Tests | |
run: | | |
python -m pytest |