-
Notifications
You must be signed in to change notification settings - Fork 11
112 lines (93 loc) · 3.3 KB
/
test.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Tests
on: [push, pull_request]
jobs:
# JOB
tests-job:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
#----------------------------------------------
#---- Checkout and install poetry and python
#----------------------------------------------
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
#----------------------------------------------
#---- install dependencies
#----------------------------------------------
- name: poetry install
run: poetry install
#----------------------------------------------
#---- show installation details
#----------------------------------------------
- name: poetry --version
run: poetry --version
- name: python --version in venv
run: poetry run python --version
- name: ls -lah
run: ls -lah
- name: poetry show
run: poetry show
#----------------------------------------------
#---- Pre-Checks
#----------------------------------------------
- name: Show clock res
run: poetry run python tests/system_checks/test_tick_rate.py
- name: Test clocks
run: poetry run python tests/system_checks/test_clocks.py
- name: Test monotonicity
run: poetry run python tests/system_checks/test_monotonic_over_threads.py
#----------------------------------------------
#---- Tests
#----------------------------------------------
- name: 🚀 Run tests with code coverage report
run: poetry run pytest --cov=dictdatabase --cov-report term-missing
#----------------------------------------------
#---- Save coverage artifact
#----------------------------------------------
- uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage
# JOB
cov-badge-job:
needs: tests-job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
#----------------------------------------------
#---- Coverage badge
#----------------------------------------------
- name: ls-lah
run: ls -lah
- uses: actions/download-artifact@v3
with:
name: coverage
- name: GenerateCoverage Badge
uses: tj-actions/coverage-badge-py@v2
with:
output: assets/coverage.svg
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: changed_files
with:
files: assets/coverage.svg
- name: Commit files
if: steps.changed_files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add assets/coverage.svg
git commit -m "Updated assets/coverage.svg"
- name: Push changes
if: steps.changed_files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.github_token }}
branch: ${{ github.ref }}