-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (116 loc) · 3.52 KB
/
build.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
name: CI
on:
push:
branches:
- main
- dev
jobs:
style:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check style
uses: DoozyX/[email protected]
with:
clangFormatVersion: 12
cppcheck:
runs-on: ubuntu-latest
needs: [style]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cppcheck
run: sudo apt install -y cppcheck
- name: Run cppcheck
run: |
cppcheck --version
make cppcheck
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
needs: [style]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Restore timestamps
shell: bash
run: bash tool/git-restore-mtime.sh
- name: Checkout lfs files
shell: bash
run: git lfs checkout
- name: Cache workspace directory
id: cache
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-
- name: Configure
shell: bash
run: |
test "${{ matrix.os }}" == "ubuntu-latest" && export CC=gcc-11 && export CXX=g++-11
cmake . -B ./build -DCMAKE_BUILD_TYPE=Release
- name: Build (Parallel)
if: ${{ matrix.os != 'macos-latest' }}
shell: bash
run: |
cmake --build ./build --target je2be-test --config Release --parallel $(nproc)
- name: Build (Serial)
if: ${{ matrix.os == 'macos-latest' }}
shell: bash
run: |
cmake --build ./build --target je2be-test --config Release
- name: Test
shell: bash
run: |
test "${{ matrix.os }}" == "windows-latest" && cd build/Release
test "${{ matrix.os }}" != "windows-latest" && cd build
./je2be-test --duration=true
analysis:
runs-on: ubuntu-latest
needs: [style]
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Checkout lfs files
shell: bash
run: git lfs checkout
- name: Install tools
run: |
wget -q -O - https://files.pvs-studio.com/etc/pubkey.txt | sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.pvs-studio.com/etc/viva64.list
sudo apt update
sudo apt install pvs-studio
pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }}
- name: Build
run: |
CC=gcc-11 CXX=g++-11 cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ./build .
cmake --build ./build --target je2be --parallel $(nproc)
- name: Analyze
run: |
pvs-studio-analyzer analyze -f ./build/compile_commands.json -j $(nproc) -e ./build/_deps -e ./test -e ./example
- name: Convert report
run: |
plog-converter --excludedCodes V1042 -t sarif -o pvs-report.sarif PVS-Studio.log
- name: Publish report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: pvs-report.sarif
category: PVS-Studio