-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (99 loc) · 2.93 KB
/
test-run.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
113
114
115
116
117
118
119
120
121
122
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
smoke-test-on-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install -r test_requirements.txt
- name: Run main tests
run: python -m pytest
build-and-test:
runs-on: ${{ matrix.platform }}
needs: smoke-test-on-linux
strategy:
matrix:
python-version: ['3.11']
platform: ['windows-latest', 'macos-latest']
include:
- python-version: '3.9'
platform: 'ubuntu-latest'
- python-version: '3.10'
platform: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install -r test_requirements.txt
- name: Run main tests
# when triggering tests with `python -m pytest` (instead of simply calling `pytest`) we add current directory to sys.path
run: python -m pytest
make-package:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip build
pip3 install -r requirements.txt
- name: Make package
run: python3 -m build
- name: Archive package as artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: |
./dist
./tests/shieldhit/resources
test-package:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
needs: make-package
steps:
- name: Fetch package as artifacts
uses: actions/download-artifact@v3
with:
name: packages
- name: Inspect what has been downloaded
run: |
ls -al
find .
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: python3 -m pip install dist/*whl
- name: Test package
run: |
yaptide-converter -h
yaptide-converter ./tests/shieldhit/resources/project.json
python3 -m converter.main -h
python3 -m converter.main ./tests/shieldhit/resources/project.json