-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.76 KB
/
tests.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
name: tests
on: [ push ]
jobs:
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: WIPACrepo/wipac-dev-flake8-action@v1.0
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12' # NOTE: update, someday.
- uses: WIPACrepo/wipac-dev-mypy-action@v1.2
code-format:
runs-on: ubuntu-latest
steps:
- if: github.actor != 'dependabot[bot]'
uses: actions/checkout@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # fyi, dependabot can't access normal secrets
- if: github.actor != 'dependabot[bot]'
run: |
git config user.name github-actions
git config user.email github-actions@github.com
# check git status
git fetch
if [[ $(git status -sb | grep behind) ]]; then
echo "this commit is not the most recent on this branch -- rest of action will be skipped"
exit 0
fi
# use literal collection syntax, see https://docs.astral.sh/ruff/rules/unnecessary-collection-call/
pip install ruff
ruff check --select C408 --fix . --unsafe-fixes
# push
git add . || true
git commit -m "<bot> auto code format file(s)" || true
git push || true
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12' # NOTE: update, someday.
- run: pip install -r requirements.txt
- run: pip install -r requirements-dev.txt
- run: |
pytest . -vvv --maxfail=1