-
Notifications
You must be signed in to change notification settings - Fork 82
148 lines (146 loc) · 5.6 KB
/
ccpp-tests.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: C/C++ CI Build and Test
on:
workflow_dispatch:
push:
branches:
- master
- feature/**
paths-ignore:
- 'python/**'
- 'tools/extra/fpgabist/**'
- 'tools/extra/packager/*.py'
- 'tools/extra/packager/metadata/**'
- 'tools/extra/packager/test/*.py'
- 'tools/extra/pac_hssi_config/*.py'
- 'tools/extra/fpgadiag/**'
- 'tools/utilities/**'
- 'scripts/*.py'
- 'platforms/scripts/platmgr/**'
- '.github/workflows/python-static-analysis.yml'
pull_request:
branches:
- master
- feature/**
paths-ignore:
- 'python/**'
- 'tools/extra/fpgabist/**'
- 'tools/extra/packager/*.py'
- 'tools/extra/packager/metadata/**'
- 'tools/extra/packager/test/*.py'
- 'tools/extra/pac_hssi_config/*.py'
- 'tools/extra/fpgadiag/**'
- 'tools/utilities/**'
- 'scripts/*.py'
- 'platforms/scripts/platmgr/**'
- '.github/workflows/python-static-analysis.yml'
jobs:
coding-style:
runs-on: ubuntu-latest
strategy:
matrix:
lang-type: [c, cpp]
steps:
- uses: actions/checkout@v3
- name: bugfix
run: sudo rm -f /var/cache/debconf/config.dat
- name: disable_snap
run: |
echo 'Package: snapd' | sudo tee /etc/apt/preferences.d/nosnap.pref
echo 'Pin: release a=*' | sudo tee -a /etc/apt/preferences.d/nosnap.pref
echo 'Pin-Priority: -10' | sudo tee -a /etc/apt/preferences.d/nosnap.pref
sudo -E DEBIAN_FRONTEND=noninteractive apt-get autopurge -y snapd
- name: update
run: sudo apt-get update -y
- name: upgrade
run: sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
- name: install
run: sudo -E DEBIAN_FRONTEND=noninteractive apt-get install -y clang-format
- name: test ${{ matrix.lang-type }}
run: ${{ github.workspace }}/scripts/test-codingstyle-all.sh ${{ matrix.lang-type }}
build:
runs-on: ubuntu-latest
strategy:
matrix:
build-type: [Debug, Release, RelWithDebInfo]
steps:
- uses: actions/checkout@v3
- name: bugfix
run: sudo rm -f /var/cache/debconf/config.dat
- name: disable_snap
run: |
echo 'Package: snapd' | sudo tee /etc/apt/preferences.d/nosnap.pref
echo 'Pin: release a=*' | sudo tee -a /etc/apt/preferences.d/nosnap.pref
echo 'Pin-Priority: -10' | sudo tee -a /etc/apt/preferences.d/nosnap.pref
sudo -E DEBIAN_FRONTEND=noninteractive apt-get autopurge -y snapd
- name: update
run: sudo apt-get update -y
- name: upgrade
run: sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
- name: install
run: sudo -E DEBIAN_FRONTEND=noninteractive apt-get install -y uuid-dev libjson-c-dev libhwloc-dev lcov libtbb-dev linux-headers-generic libedit-dev libudev-dev libcap-dev
- name: Get Python packages
run: python3 -m pip install setuptools --user
- name: configure ${{ matrix.build-type }}
run: mkdir ${{ github.workspace }}/.build && cd ${{ github.workspace }}/.build && cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: make ${{ matrix.build-type }}
run: cd ${{ github.workspace }}/.build && make -j $(nproc)
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: bugfix
run: sudo rm -f /var/cache/debconf/config.dat
- name: disable_snap
run: |
echo 'Package: snapd' | sudo tee /etc/apt/preferences.d/nosnap.pref
echo 'Pin: release a=*' | sudo tee -a /etc/apt/preferences.d/nosnap.pref
echo 'Pin-Priority: -10' | sudo tee -a /etc/apt/preferences.d/nosnap.pref
sudo -E DEBIAN_FRONTEND=noninteractive apt-get autopurge -y snapd
- name: update
run: sudo apt-get update -y
- name: upgrade
run: sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
- name: install
run: sudo -E DEBIAN_FRONTEND=noninteractive apt-get install -y uuid-dev libjson-c-dev libhwloc-dev lcov libtbb-dev libedit-dev libudev-dev libcap-dev
- name: set hugepages
run: sudo sysctl -w vm.nr_hugepages=8
- name: run unit tests
run: ${{ github.workspace }}/scripts/cover.sh
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: unittests/coverage.info.cleaned
build-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: update
run: sudo apt-get update -y
- name: Build Docker image
run: docker build . -f docker/docs/Dockerfile -t opae/docs-builder
- name: Build Documentation
run: docker run --rm -v ${{ github.workspace }}:/root opae/docs-builder ./scripts/build-documentation.sh
- name: Upload latest to github.io
if: ${{ github.ref == 'refs/heads/master' }}
working-directory: ${{ github.workspace }}/mybuild_docs
run: ${{ github.workspace }}/scripts/push-documentation.sh latest
- name: Upload tag to github.io
if: startsWith(github.ref, 'refs/tags/')
working-directory: ${{ github.workspace }}/mybuild_docs
run: ${{ github.workspace }}/scripts/push-documentation.sh "${GITHUB_TAG##*/}"
- name: Archive html docs
uses: actions/upload-artifact@v3
with:
name: docs
path: mybuild_docs/sphinx/html
- name: (lychee) Link Checker
uses: lycheeverse/lychee-action@v1
with:
args: --verbose --no-progress mybuild_docs/sphinx/html
output: ${{ github.workspace }}/lychee
- name: Archive lychee results
uses: actions/upload-artifact@v3
with:
name: link-checker
path: ${{ github.workspace }}/lychee