-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (92 loc) · 2.76 KB
/
main.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
name: PDF Combine CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov pytest-benchmark pytest-mock
- name: Run core tests
run: |
pytest tests/ -v -m "not benchmark and not win32" --cov=src/ --cov-report=xml --cov-report=html
- name: Run Windows-specific tests
if: runner.os == 'Windows'
run: |
pytest tests/ -v -m "win32" --cov=src/ --cov-report=xml --cov-report=html --cov-append
- name: Run benchmark tests
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
pytest tests/ -v -m "benchmark" --benchmark-only
- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests
name: codecov-pdf-combine
fail_ci_if_error: false
- name: Upload benchmark results
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: benchmark-results
path: .benchmarks/
- name: Upload coverage HTML report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: htmlcov/
build:
needs: test
runs-on: windows-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build executable
run: python build.py
- name: Create release assets
run: |
mkdir release
copy "dist/PDF Combine.exe" release/
copy LICENSE release/
copy README.md release/
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: pdf-combine-windows
path: release/
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: release/*
body_path: CHANGELOG.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}