push: refs/heads/ci-update #1344
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 | |
run-name: "${{ github.event_name }}: ${{ github.ref }}" | |
on: | |
push: | |
pull_request: | |
branches: | |
- "master" | |
schedule: | |
- cron: "0 3 * * 1" # weekly on Monday | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macOS-latest, ubuntu-latest] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
env: | |
CI_OS: ${{ matrix.os }} | |
PYVER: ${{ matrix.python-version }} | |
PACKAGE: "opencadd" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Additional info about the build | |
shell: bash | |
run: | | |
uname -a | |
df -h | |
ulimit -a | |
- name: 'Setup conda environment' | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
create-args: python=${{ matrix.python-version }} | |
environment-file: devtools/conda-envs/test_env.yaml | |
micromamba-version: latest | |
generate-run-shell: true | |
init-shell: bash | |
condarc: | | |
channels: | |
- conda-forge | |
- defaults | |
- bioconda | |
# TODO: Remove this step when patched theseus makes it to CF | |
- name: Build patched mmligner | |
shell: micromamba-shell {0} | |
run: | | |
micromamba install conda-build | |
conda build devtools/conda-recipes/mmligner/ | |
- name: Install package | |
shell: micromamba-shell {0} | |
run: | | |
micromamba install -c local mmligner pip | |
python -m pip install . --no-deps | |
micromamba list | |
- name: Run tests | |
shell: micromamba-shell {0} | |
run: | | |
pytest -v --cov=${PACKAGE} --cov-report=xml --color=yes ${PACKAGE}/tests/ | |
- name: CodeCov | |
if: github.event_name == 'push' && github.ref_name == 'master' | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests | |
yml: ./.codecov.yml | |
############# | |
lint-format: | |
runs-on: ubuntu-latest | |
env: | |
PACKAGE: "opencadd" | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: 'Setup Python' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install linter and formatter | |
run: | | |
python -m pip install pylint black | |
- name: Run pylint | |
run: pylint $PACKAGE/ | |
- name: Run black check | |
if: always() | |
run: black --check -l 99 $PACKAGE/ |