-
Notifications
You must be signed in to change notification settings - Fork 6
102 lines (83 loc) · 2.46 KB
/
main.yml
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
name: CI
on:
push:
branches:
- main
pull_request:
branches_ignore: []
defaults:
run:
shell: bash -el {0}
jobs:
cancel-previous:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: khan/[email protected]
with:
workflows: "main.yml"
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
linting:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Install system dependencies
run: sudo apt-get install -y libbz2-dev liblzma-dev
- name: Setup environment variables
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,bioconda,nodefaults
environment-file: 'environment.yaml'
python-version: ${{ matrix.python-version }}
- name: Set up Python
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Run linting tools
run: |
make lint
- name: Comment PR
if: github.event_name == 'pull_request' && failure()
uses: marocchino/[email protected]
with:
message: 'Please check your code via `make lint`.'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
testing:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
needs: linting
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Install system dependencies
run: sudo apt-get install -y libbz2-dev liblzma-dev
- name: Setup environment variables
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,bioconda,nodefaults
environment-file: 'environment.yaml'
python-version: ${{ matrix.python-version }}
- name: Set up Python
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Run tests
run: uv run pytest
- uses: codecov/codecov-action@v3