-
Notifications
You must be signed in to change notification settings - Fork 16
75 lines (61 loc) · 1.98 KB
/
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
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/cpm_modules
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: 3.18.4
- name: test and install local build
run: |
cmake -S test -B build/local
cmake --build build/local
cmake --build build/local --target test
sudo -E cmake --build build/local --target install
- name: test installed build
run: |
cmake -S test -B build/installed -D TEST_INSTALLED_VERSION=1
cmake --build build/installed
cmake --build build/installed --target test
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/cpm_modules
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: 3.18.4
- name: build for packaging
run: |
cmake -S test -B build/local -DTEST_CPACK=YES
cmake --build build/local
cmake --build build/local --target test
cd build/local
cpack -G DEB .
dpkg -I *deb | grep "Maintainer: Foo Bar <[email protected]>"
sudo -E dpkg -i *.deb
- name: test installed build
run: |
cmake -S test -B build/installed -D TEST_INSTALLED_VERSION=1
cmake --build build/installed
cmake --build build/installed --target test