-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 2.1 KB
/
main-branch.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
76
name: Test, build, and publish the package
on:
push:
branches: [main]
jobs:
test-and-build-and-update-metadata:
name: Test, build, and publish the package
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_GITHUB_ACTIONS }}
- uses: actions/setup-python@v4
with:
cache: pip
python-version: '3.9'
- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Check requirements.txt is up to date
run: |
source venv/bin/activate
pip install .[all]
pip uninstall -y service-oriented
pip freeze > requirements.txt
if ! `git diff --quiet`; then
echo "pip freeze caused file changes, failing!"
git diff
exit 1
fi
- name: Check style
run: |
source venv/bin/activate
make style
if ! `git diff --quiet`; then
echo "make style caused file changes, failing!"
git diff
exit 1
fi
- name: Run tests and build package
run: |
source venv/bin/activate
coverage run -m pytest
coverage report | tee .meta/coverage/report.txt
coverage-badge -f -o .meta/coverage/badge.svg
python -m build
- name: Checkout tdg5/github-action-pack
uses: actions/checkout@v4
with:
path: .github/actions/tdg5/github-action-pack
ref: v0.0.5
repository: tdg5/github-action-pack
- name: Commit and push code coverage snapshot
uses: ./.github/actions/tdg5/github-action-pack/packages/stage-files-and-commit-and-push-action/src
with:
authorEmail: dannyguinther+spamburglar@gmail.com
authorName: Spamburglar
commitMessage: "[skip actions] Update code coverage snapshot"
optionalFilePaths: |
.meta/coverage/badge.svg
.meta/coverage/report.txt