Skip to content

Attempt 3 to get CI working on Mac #51

Attempt 3 to get CI working on Mac

Attempt 3 to get CI working on Mac #51

Workflow file for this run

name: CI
on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# The cookiecutter uses the "--initial-branch" flag when it runs git-init
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
# Weekly tests run on main by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * 0"
jobs:
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test.yaml
environment-name: red
create-args: >- # beware the >- instead of |, we don't split on newlines but on spaces
python=${{ matrix.python-version }}
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
micromamba install -y -n red -c conda-forge -c defaults git make
apt update && apt install -y git make
python -m pip install . --no-deps
micromamba list
- name: Check formatting
shell: bash -l {0}
run: |
make format
git diff --exit-code
- name: Lint
shell: bash -l {0}
run: |
make lint
- name: Type check
shell: bash -l {0}
run: |
make type-check
- name: Run tests
# conda setup requires this special shell
shell: bash -l {0}
run: |
make test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml