-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (56 loc) · 1.89 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
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request:
types: [opened, reopened, synchronize, ready_for_review, closed]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "linting"
linting:
name: Lint code
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Setup environment
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.2
with:
python-version: ${{ matrix.python-version }}
- name: Run ruff
run: poetry run ruff autobidsportal
- name: Run isort
run: poetry run isort --check autobidsportal
- name: Run black
run: poetry run black --check autobidsportal
- name: Run pyright
run: poetry run pyright autobidsportal
- name: run djLint
run: |
poetry run djlint --lint autobidsportal/templates
poetry run djlint --check autobidsportal/templates
test:
name: Set up environment and run tests
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
redis-version: [6]
steps:
- name: Setup environment
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.2
with:
python-version: ${{ matrix.python-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.1.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Run pytest
shell: bash
run: |
poetry run pytest