-
Notifications
You must be signed in to change notification settings - Fork 18
103 lines (88 loc) · 2.59 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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/