-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (78 loc) · 2.56 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
name: Build and Test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_call:
permissions:
contents: read
jobs:
build-and-test-msbuild:
name: Build and Test (Visual Studio)
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
- name: Install dependencies
run: nuget restore .
- name: Build
run: msbuild /m /p:Configuration=Release .
- name: Setup VSTest
uses: darenm/Setup-VSTest@v1
- name: Run tests
run: vstest.console.exe /Platform:x64 x64/Release/test.dll
- name: Upload built plugin
uses: actions/upload-artifact@v3
with:
name: built-plugin-windows
path: Release/plugins/XPanel/64/*
- name: Upload test logs
uses: actions/upload-artifact@v3
with:
name: test_log
path: x64/Release/test_log.txt
build-and-test-cmake:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest]
name: Build and Test (CMake, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install dependencies
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update -qq && sudo apt-get install -y build-essential cmake liblua5.4-dev libhidapi-dev
echo 'XPANEL_INSTALL_DEPS_FLAG=-DINSTALL_DEPS=ON' >> $GITHUB_ENV
- name: Build
run: |
cmake -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" -S . -B build ${XPANEL_INSTALL_DEPS_FLAG}
cmake --build build
- name: Run tests
run: ctest build
- name: Install
run: cmake --build build --target install
- name: Upload built plugin (Linux glibc 2.35)
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v3
with:
name: built-plugin-linux
path: ${{ github.workspace }}/install/XPanel/64/*
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y pandoc weasyprint fonts-noto fonts-liberation2
- uses: actions/checkout@v3
- name: Generate PDF
working-directory: ./doc
run: pandoc -f gfm -t pdf --pdf-engine weasyprint -c style.css -o documentation.pdf documentation.md
- name: Upload docs
uses: actions/upload-artifact@v3
with:
name: docs
path: doc/documentation.pdf