-
Notifications
You must be signed in to change notification settings - Fork 83
91 lines (73 loc) · 1.99 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
name: Test
on:
workflow_dispatch:
push:
branches: [main, dev]
pull_request_target:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
cloc:
runs-on: ubuntu-latest
name: Count Lines of Code
steps:
- uses: actions/checkout@v3
- name: Install CLoC
run: |
sudo apt-get update
sudo apt-get install cloc
- name: Count Lines of Code
run: |
cloc . --md >> $GITHUB_STEP_SUMMARY
test:
runs-on: ${{ matrix.os }}
name: Testing
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- python: pypy3.8
os: ubuntu-latest
- python: pypy3.9
os: ubuntu-latest
- python: pypy3.10
os: ubuntu-latest
max-parallel: 3
defaults:
run:
shell: bash
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python }}
cache: true
- name: Install dependencies
timeout-minutes: 5
run: pdm install
- name: Testing with pytest
timeout-minutes: 15
run: |
curl -L ${{ secrets.DOTENV_LINK }} > .env
pdm test
- name: Create step summary
if: always()
run: |
echo "## Summary" >> $GITHUB_STEP_SUMMARY
echo "OS: ${{ matrix.os }}" >> $GITHUB_STEP_SUMMARY
echo "Python: ${{ matrix.python }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
pdm run coverage report -m >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- uses: codecov/codecov-action@v3
if: always()
with:
env_vars: OS,PYTHON
file: coverage.xml