-
Notifications
You must be signed in to change notification settings - Fork 78
131 lines (114 loc) · 3.33 KB
/
ci.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
on:
release:
types:
- published
push:
branches:
- master
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
env:
vcpkg-commit: 90b5fb836cda4eba4569a123bca63b957f55232b
vcpkg-install: pe-parse uthenticode
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: deps
run: |
sudo apt-get update
sudo apt-get install -y clang-format
sudo pip3 install cmake-format
- name: format
run: make format
winchecksec:
strategy:
matrix:
build-type: ["Debug", "Release"]
platform: ["ubuntu-latest", "macos-latest"]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Restore from cache and install vcpkg
uses: lukka/run-vcpkg@v6
with:
vcpkgGitCommitId: ${{ env.vcpkg-commit }}
vcpkgArguments: ${{ env.vcpkg-install }}
- name: build
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DBUILD_TESTS=1 \
..
cmake --build .
- name: tests
working-directory: build
run: ./test/winchecksec_test
- name: archive
if: github.event.release
run: zip -r build.zip build
- name: publish
if: github.event.release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build.zip
asset_name: ${{ matrix.platform }}.${{ matrix.build-type }}.zip
asset_content_type: application/zip
winchecksec-windows:
strategy:
matrix:
build-arch:
- { arch: "x64", triplet: "x64-windows" }
- { arch: "Win32", triplet: "x86-windows" }
build-type: ["Debug", "Release"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Restore from cache and install vcpkg
uses: lukka/run-vcpkg@v5
with:
vcpkgGitCommitId: ${{ env.vcpkg-commit }}
vcpkgArguments: ${{ env.vcpkg-install }}
vcpkgTriplet: ${{ matrix.build-arch.triplet }}
- name: build
shell: bash
run: |
mkdir build
cd build
cmake \
-G "Visual Studio 17 2022" \
-A ${{ matrix.build-arch.arch }} \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DBUILD_TESTS=1 \
..
cmake --build . --config ${{ matrix.build-type }}
- name: tests
working-directory: build
run: |
./test/${{ matrix.build-type }}/winchecksec_test
- name: archive
if: |
github.event.release
run:
7z a build.zip build
- name: publish
if: |
github.event.release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build.zip
asset_name: windows.${{ matrix.build-arch.arch }}.${{ matrix.build-type }}.zip
asset_content_type: application/zip