-
Notifications
You must be signed in to change notification settings - Fork 44
105 lines (105 loc) · 3.21 KB
/
unittest.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
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
name: Regression Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Packages
run: pip install codespell flake8
- name: Check Spelling
run: codespell --skip="./data"|| true
- name: Check Syntax Error
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- uses: actions/setup-go@v4
with:
go-version: '1.20.5'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
make
- name: Run unittest
run: >
COVERAGE_FILE=.coverage.${{ github.sha }}.unittest
pytest acto
--junitxml=pytest.xml
--cov-report=
--cov=acto
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: .coverage.${{ github.sha }}.unittest
path: .coverage.${{ github.sha }}.unittest
retention-days: 1
include-hidden-files: true
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Packages
run: pip install codespell flake8
- name: Check Spelling
run: codespell --skip="./data"|| true
- name: Check Syntax Error
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- uses: actions/setup-go@v4
with:
go-version: '1.20.5'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
make
- name: Run integration test
run: >
COVERAGE_FILE=.coverage.${{ github.sha }}.integration-test
pytest test/integration_tests
--junitxml=pytest.xml
--cov-report=
--cov=acto
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: .coverage.${{ github.sha }}.integration-test
path: .coverage.${{ github.sha }}.integration-test
retention-days: 1
include-hidden-files: true
coverage-report:
runs-on: ubuntu-latest
needs: [unittest, integration-test]
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Download unittest coverage
uses: actions/download-artifact@v4
with:
name: .coverage.${{ github.sha }}.unittest
- name: Download integration test coverage
uses: actions/download-artifact@v4
with:
name: .coverage.${{ github.sha }}.integration-test
- name: Merge coverage files
run: |
pip install coverage
coverage combine
- name: list files
run: ls -al
- name: Coverage comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
ANNOTATE_MISSING_LINES: true