-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (72 loc) · 3.15 KB
/
master-workflow.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Master Workflow
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.12']
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install basic dependencies
uses: ./.github/actions/basic
- name: Test with pytest
run: |
pip install -r requirementstest.txt
python -m pytest --cov=src --cov-report html:html-${{matrix.os}}-${{matrix.python-version}} --doctest-modules --junitxml=junit/test-results-${{matrix.os}}-${{matrix.python-version}}.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{matrix.os}}-${{matrix.python-version}}
path: junit/test-results-${{matrix.os}}-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{always()}}
- name: Zip test result windows
if: ${{ success() && runner.os == 'Windows'}}
run: Compress-Archive html-${{matrix.os}}-${{matrix.python-version}}/ html-${{matrix.os}}-${{matrix.python-version}}.zip
- name: Zip test result not windows
if: ${{ success() && runner.os != 'Windows'}}
run: zip -r html-${{matrix.os}}-${{matrix.python-version}}.zip html-${{matrix.os}}-${{matrix.python-version}}/
- name: Upload cobertura results
uses: actions/upload-artifact@v4
with:
name: html-${{matrix.os}}-${{matrix.python-version}}.zip
path: html-${{matrix.os}}-${{matrix.python-version}}.zip
# Use always() to always run this step to publish test results when there are test failures
if: ${{ success() }}
- name: Windows Integration tests with behave
if: ${{ success() && runner.os == 'Windows'}}
run: |
nohup python main.py run -c icconfig/config.json > nohup.out 2> null &
sleep 10
sh behave.sh --format progress3
- name: Not Windows Integration tests with behave
if: ${{ success() && runner.os != 'Windows'}}
run: |
nohup python main.py run -c icconfig/config.json > nohup.out 2> nohup.err < /dev/null &
sleep 10
sh behave.sh --format progress3
kill -9 $(lsof -i:9090 -t)
- name: Making Executables
uses: ./.github/actions/pyinstaller
- name: Upload windows Exe
if: ${{ success() && runner.os == 'Windows'}}
uses: actions/upload-artifact@v4
with:
name: WTFinances.exe
path: ./pyinstaller/dist/WTFinances.exe
- name: Upload not windows executable
if: ${{ success() && runner.os != 'Windows'}}
uses: actions/upload-artifact@v4
with:
name: WTFinances-${{matrix.os}}
path: ./pyinstaller/dist/WTFinances