-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (84 loc) · 2.72 KB
/
ci.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
name: CI
on:
pull_request:
branches:
- main
jobs:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11' # may as well use 3.11 as it's faster
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff black darglint
- name: Format with black
run: |
python -m black --check .
- name: Lint with ruff
run: |
ruff check --format=github .
- name: Lint with darglint
run: |
darglint --verbosity 2 --docstring-style sphinx -z long conduit
test_minimal_dependencies:
needs: [linters]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.8'
# We are verifying here that it's possible to to import `EcoacousticsDataModule`
# when basically only the audio dependencies are installed.
- name: Install minimal dependencies
run: |
poetry env use 3.8
poetry install --no-interaction --no-root --with torchcpu --without image --without hydra --without download --without logging --without dev
- name: Verify audio datamodule can be imported
run: |
poetry run python -c "from conduit.data.datamodules.audio import EcoacousticsDataModule"
ci_suite:
needs: [linters]
runs-on: ubuntu-latest
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'poetry'
#----------------------------------------------
# install dependencies
#----------------------------------------------
- name: Install dependencies
run: |
poetry env use 3.8
poetry install --no-interaction --no-root --with torchcpu --with fair
- name: Set python path for all subsequent actions
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
#----------------------------------------------
# type check
#----------------------------------------------
- uses: jakebailey/pyright-action@v1
with:
# don't show warnings
level: error
#----------------------------------------------
# run tests
#----------------------------------------------
- name: Test with pytest
run: |
poetry run python -m pytest -vv tests/
# - name: Run configen
# run: |
# poetry run sh generate_confs.sh