-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (79 loc) · 2.53 KB
/
coverity.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
name: Coverity
on:
push:
branches:
- coverityScan
jobs:
scan-linux:
runs-on: ubuntu-20.04
if: github.repository == 'bad-alloc-heavy-industries/substrate'
strategy:
fail-fast: false
steps:
- name: Runtime environment
shell: bash
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: Setup GCC
shell: bash
run: |
CXX=${CC/#gcc/g++}
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install $CC $CXX
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "GCOV=${CC/#gcc/gcov}" >> $GITHUB_ENV
env:
CC: gcc-11
- name: Checkout substrate
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja
shell: bash
run: |
sudo pip3 install --upgrade pip setuptools wheel
pip3 install --user meson ninja
working-directory: ${{ runner.temp }}
- name: Version tools
shell: bash
run: |
$CC --version
$CXX --version
$GCOV --version
meson --version
ninja --version
- name: Install Coverity
shell: bash
run: |
.github/installCoverity.sh
env:
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
COVERITY_PROJECT_NAME: substrate
- name: Run Coverity
shell: bash
run: |
meson setup build --prefix=$HOME/.local -Dcpp_std=c++17
cov-build --dir cov-int ninja -C build
env:
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
- name: Upload Coverity
shell: bash
run: |
VERSION=`meson introspect build --projectinfo | jq -r '.["version"]'`-`git rev-parse --short HEAD`
tar cJf substrate.tar.xz cov-int
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
--form [email protected] \
--form [email protected] \
--form version=$VERSION \
--form description="A collection of headers containing useful tools and gadgets for building C++ programs" \
https://scan.coverity.com/builds?project=${COVERITY_PROJECT_NAME}
- name: Debug
if: failure()
shell: bash
run: cat cov-int/build-log.txt