-
Notifications
You must be signed in to change notification settings - Fork 43
108 lines (93 loc) · 3.12 KB
/
build_and_test.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
name: Build & Test
on:
push:
branches: [ master ]
schedule:
- cron: "0 0 * * *"
jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, ubuntu-20.04, windows-2022]
steps:
- if: matrix.os == 'windows-2022'
name: Install Cppcheck, OpenCppCoverage, and wkhtmltopdf (Windows)
run: |
choco install -y --ignore-package-exit-codes cppcheck opencppcoverage wkhtmltopdf
echo "C:\Program Files\Cppcheck" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\wkhtmltopdf" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- if: matrix.os == 'windows-2022'
name: Configure MSVC (Windows)
uses: ilammy/msvc-dev-cmd@v1
- name: Configure Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Meson and Ninja
run: |
pip3 install --upgrade meson ninja
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build - Release
run: |
meson setup --buildtype=release builddir
meson compile -C builddir
- name: Test - Release
run: |
meson test -vC builddir
- if: matrix.os == 'windows-2022'
name: Release (Windows)
uses: ncipollo/release-action@v1
with:
allowUpdates: true
replacesArtifacts: true
tag: latest-win
name: Lastest (Windows)
artifacts: builddir/libDSPatch.a
artifactContentType: application/octet-stream
commit: ${{ github.sha }}
- if: matrix.os == 'macos-12'
name: Release (MacOS)
uses: ncipollo/release-action@v1
with:
allowUpdates: true
replacesArtifacts: true
tag: latest-mac
name: Lastest (MacOS)
artifacts: builddir/libDSPatch.a
artifactContentType: application/octet-stream
commit: ${{ github.sha }}
- if: matrix.os == 'ubuntu-20.04'
name: Release (Linux)
uses: ncipollo/release-action@v1
with:
allowUpdates: true
replacesArtifacts: true
tag: latest-linux
name: Lastest (Linux)
artifacts: builddir/libDSPatch.a
artifactContentType: application/octet-stream
commit: ${{ github.sha }}
- if: matrix.os == 'windows-2022'
name: Build - Debug (Windows)
run: |
meson setup --buildtype=debug --wipe builddir
meson compile -C builddir
- if: matrix.os == 'windows-2022'
name: Test - Debug (Windows)
run: |
meson test -vC builddir
meson compile ./codecoverage -C builddir
$files = (Get-ChildItem -R .\builddir\coverage\*.html)
[array]::Reverse($files)
wkhtmltopdf --enable-local-file-access --disable-external-links --header-center [title] $files coverage.pdf
- if: matrix.os == 'windows-2022'
name: Upload Coverage Report (Windows)
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage.pdf