-
Notifications
You must be signed in to change notification settings - Fork 8
96 lines (84 loc) · 2.47 KB
/
push.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
---
name: Commit
on: push
jobs:
tests:
name: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setting up tox environment
uses: docker://kiwicom/tox:3.25.0
env:
TOXENV: ${{ matrix.toxenv }}
XDG_CACHE_HOME: /tmp/cache
with:
args: >
sh -c
"
mkdir -p reports ;
tox -e tests-$TOXENV -- --junitxml=reports/$TOXENV/test_report.xml --cov structlog_sentry --cov-report xml --cov-config .coveragerc --cov-append --cov-report xml:reports/coverage.xml
"
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: .tox
key: ${{ runner.os }}-${{ hashFiles('requirements.txt') }}
strategy:
matrix:
toxenv: [py39, py310, py311]
lint:
name: pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setting up tox environment
uses: docker://kiwicom/tox
env:
XDG_CACHE_HOME: /tmp/cache
with:
args: >
sh -c
"
mkdir -p reports ;
tox -e pylint
"
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: .tox
key: ${{ runner.os }}-${{ hashFiles('requirements.txt') }}
commitsar:
name: Commit message style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run commitsar
uses: docker://aevea/commitsar
pre-commit:
name: Static checks
runs-on: ubuntu-latest
container: kiwicom/pre-commit:3.6.0
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Cache
uses: actions/cache@v4
with:
path: .pre-commit-cache
key: static-checks-${{ hashFiles('.pre-commit-config.yaml') }}
# git checkout is not creating a working git folder, it has dubious ownership if not configured
# The pre-commit hook will not work on this original git folder
# https://github.com/pre-commit/pre-commit/issues/2125
- name: fix git
run: git config --system --add safe.directory '*'
- run: mkdir -p .pre-commit-cache
- run: pre-commit install --install-hooks
- run: pre-commit run -a
env:
SKIP: no-commit-to-branch