-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 1.97 KB
/
checks.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
name: Checks
on:
push:
branches:
- main
paths-ignore:
- '.vscode/**'
- '.gitignore'
- 'README.md'
- 'ACCESS.md'
pull_request:
branches:
- main
paths-ignore:
- '.vscode/**'
- '.gitignore'
- 'README.md'
- 'ACCESS.md'
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set up or use existing virtual environment
run: |
VENV_PATH="/home/user/actions-runner/rib-env"
if [ ! -d "$VENV_PATH" ]; then
echo "Creating a new virtual environment."
python -m venv "$VENV_PATH"
else
echo "Using existing virtual environment."
fi
- name: Install or update dependencies
run: |
source /home/user/actions-runner/rib-env/bin/activate
python -m pip install --upgrade pip
pip install ".[dev]"
- name: Check with Black
run: |
source /home/user/actions-runner/rib-env/bin/activate
black --check --diff --line-length 100 rib rib_scripts tests
- name: Check with isort
run: |
source /home/user/actions-runner/rib-env/bin/activate
isort --check --thirdparty wandb --profile black rib rib_scripts tests
- name: Check unused imports with pylint
run: |
source /home/user/actions-runner/rib-env/bin/activate
pylint --disable=all --enable=unused-import --score=n rib rib_scripts tests
- name: Check with mypy
run: |
source /home/user/actions-runner/rib-env/bin/activate
mypy rib rib_scripts
- name: Run tests
# Note that we run need to run the distributed tests in separate processes
run: |
source /home/user/actions-runner/rib-env/bin/activate
pytest --runslow --durations=10
./tests/run_distributed_tests.sh