-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.03 KB
/
python.yml
File metadata and controls
83 lines (68 loc) · 2.03 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
name: Python
run-name: Pipeline run by @${{ github.actor }} on ${{ github.ref}} 🚀
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pipenv
- name: Install dependencies
run: |
cd py/
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv install --dev
pipenv run pytest --version
- uses: chartboost/ruff-action@v1
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pipenv
- name: Install dependencies
run: |
cd py/
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv install --dev
pipenv run pytest --version
- name: Test with pytest
run: |
cd py/
for d in $(ls -d */tests/); do
prog=$(dirname $d)
echo "Runing tests for $prog"
pipenv run pytest -v $prog --junitxml=junit/test-results-${prog}-${{ matrix.python-version }}.xml
done
- name: Test with shell
run: |
cd py/
for d in $(ls -d */tests/); do
(
prog=$(dirname $d)
cd $d
echo $PWD
./test.sh | tee ../../junit/function-test-results-${prog}.xml
)
done
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-*${{ matrix.python-version }}.xml
if: ${{ always() }}