Skip to content

Commit

Permalink
Update ci.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Jan 30, 2024
1 parent c76e87c commit 527fd52
Showing 1 changed file with 30 additions and 38 deletions.
68 changes: 30 additions & 38 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#!/bin/bash
name: CI
run-name: "${{ github.event_name }}: ${{ github.ref }}"

on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
schedule:
# Run a cron job once weekly on Monday
- cron: "0 3 * * 1"
- cron: "0 3 * * 1" # weekly on Monday
workflow_dispatch:

jobs:
test:
Expand All @@ -20,14 +18,14 @@ jobs:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: [3.7, 3.8]
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@v3
- uses: actions/checkout@v4

- name: Additional info about the build
shell: bash
Expand All @@ -36,36 +34,41 @@ jobs:
df -h
ulimit -a
- uses: conda-incubator/setup-miniconda@v2
- name: 'Setup conda environment'
uses: mamba-org/setup-micromamba@v1
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: test
create-args: python=${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
channels: conda-forge,defaults,bioconda
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: bash -l {0}
shell: micromamba-shell {0}
run: |
conda activate base
conda install conda-build
micromamba install conda-build
conda build devtools/conda-recipes/mmligner/
- name: Install package
shell: bash -l {0}
shell: micromamba-shell {0}
run: |
conda install -c local mmligner pip
micromamba install -c local mmligner pip
python -m pip install . --no-deps
conda list
micromamba list
- name: Run tests
shell: bash -l {0}
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 }}
Expand All @@ -77,35 +80,24 @@ jobs:
lint-format:
runs-on: ubuntu-latest
env:
CI_OS: ubuntu-latest
PACKAGE: "opencadd"
PYVER: "3.8"

steps:
- name: Checkout the code
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
- name: 'Setup Python'
uses: actions/setup-python@v5
with:
python-version: "3.8"
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: test
environment-file: devtools/conda-envs/test_env.yaml
channels: conda-forge,defaults,bioconda
python-version: '3.x'

- name: Install linter and formatter
shell: bash -l {0}
run: |
conda install -y pylint black
python -m pip install pylint black
- name: Run pylint
shell: bash -l {0}
run: |
pylint $PACKAGE/
run: pylint $PACKAGE/

- name: Run black check
shell: bash -l {0}
if: always()
run: |
black --check -l 99 $PACKAGE/
run: black --check -l 99 $PACKAGE/

0 comments on commit 527fd52

Please sign in to comment.