forked from INTI-CMNB/KiBot
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (90 loc) · 3.07 KB
/
Copy pathpythonapp_test.yml
File metadata and controls
95 lines (90 loc) · 3.07 KB
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Regression tests
on:
push:
paths:
- '**.py'
- 'g*.sh'
- 'src/kibot'
- 'tests/**'
- '.github/workflows/pythonapp.yml'
- 'tools/dev_image/Dockerfile'
- 'tools/dev_image_k6/Dockerfile'
pull_request:
paths:
- '**.py'
- 'g*.sh'
- 'src/kibot'
- 'tests/**'
- '.github/workflows/pythonapp.yml'
- 'tools/dev_image/Dockerfile'
- 'tools/dev_image_k6/Dockerfile'
repository_dispatch:
types: [run_tests]
workflow_dispatch:
jobs:
test:
strategy:
fail-fast: false
matrix:
ki_release: [ki9]
w_tests: [g3]
runs-on: ubuntu-latest
container: ghcr.io/inti-cmnb/kicad_auto_test:${{ matrix.ki_release }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Test ${{ matrix.ki_release }}
env:
KI_RELEASE: ${{ matrix.ki_release }}
PIP_OPS: ${{ matrix.ki_release != 'ki5' && '--break-system-packages' || ''}}
run: |
rm -rf output
rm -f tests/.local
##### Experimental stuff:
## Remove KiAuto
#dpkg --remove --force-all kiauto
## Install KiAuto@master
#curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip
#unzip pp.zip
#pip3 install ${PIP_OPS} KiAuto-master/
## Clean the downloaded stuff
#rm -rf KiAuto-master/ pp.zip
## Install KiDiff@master
#curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip
#unzip pp.zip
#pip3 install ${PIP_OPS} KiDiff-master/
## Clean the downloaded stuff
#rm -rf KiDiff-master/ pp.zip
## Check what we got
#echo $PATH
#ls -la /usr/bin/*_do || true
#ls -la /usr/local/bin/*_do || true
#which pcbnew_do
#pcbnew_do --version
# KiDiff tests
#curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/kiri_mode --output pp.zip
#unzip pp.zip
#prefix=/usr make -C KiDiff-kiri_mode install
#rm -rf KiDiff-kiri_mode/ pp.zip
#kicad-diff.py --version
##### End Experimental stuff
# Ensure we start a fresh coverage meassurement
python3-coverage erase
# Create the caches with macros
python3-coverage run src/kibot --help-outputs > /dev/null
# Individual run for specific tests
# pytest --log-cli-level debug -k "test_ibom_parse_fail" --test_dir=output
# Run the 90% faster tests (under 3 s) together
# Do it in parallel
./${{ matrix.w_tests }}.sh
- name: Store results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Test_Output_${{ matrix.ki_release }}_${{ matrix.w_tests }}
# Important! empty directories are skipped!!!!
path: output
include-hidden-files: true