generated from tier4/ros2-project-template
-
Notifications
You must be signed in to change notification settings - Fork 64
135 lines (121 loc) · 4.2 KB
/
build-and-test-differential.yaml
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
name: build-and-test-differential
on:
pull_request:
jobs:
build-and-test-differential:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
rosdistro:
- humble
include:
- rosdistro: humble
container: ros:humble
build-depends-repos: build_depends.repos
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Remove exec_depend
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
- name: Get modified packages
id: get-modified-packages
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
- name: Build
id: build
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-build@v1
with:
rosdistro: ${{ matrix.rosdistro }}
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: ${{ matrix.build-depends-repos }}
- name: Upload build artifacts for static analysis
if: ${{ steps.build.outcome == 'success' }}
uses: actions/upload-artifact@v4
with:
name: static-analysis-resources-${{ github.sha }}
path: |
build/compile_commands.json
build/**/*.c
build/**/*.cc
build/**/*.cpp
build/**/*.h
build/**/*.hh
build/**/*.hpp
dependency_ws/
if-no-files-found: error
- name: Test
id: test
if: ${{ steps.build.outcome == 'success' }}
uses: autowarefoundation/autoware-github-actions/colcon-test@v1
with:
rosdistro: ${{ matrix.rosdistro }}
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: ${{ matrix.build-depends-repos }}
- name: Upload coverage to CodeCov
if: ${{ steps.test.outputs.coverage-report-files != '' }}
uses: codecov/codecov-action@v4
with:
files: ${{ steps.test.outputs.coverage-report-files }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true
flags: differential
fb-infer-differential:
runs-on: ubuntu-latest
needs: [build-and-test-differential]
if: ${{ needs.build-and-test-differential.result }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
rosdistro:
- humble
include:
- rosdistro: humble
container: ros:humble
build-depends-repos: build_depends.repos
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download static analysis resources
id: download-compile-db
uses: actions/download-artifact@v4
with:
name: static-analysis-resources-${{ github.sha }}
continue-on-error: true
- name: Install FB Infer
id: fb-infer-install
if: ${{ steps.download-compile-db.outcome == 'success' }}
env:
VERSION: 1.2.0
run: |
export BASENAME="infer-linux-x86_64-v${VERSION}"
export FILENAME="${BASENAME}.tar.xz"
curl -sSLO "https://github.com/facebook/infer/releases/download/v${VERSION}/${FILENAME}"
tar -xf "$FILENAME"
rm "$FILENAME"
sudo mv "$BASENAME" /usr/local/infer
echo "PATH=/usr/local/infer/bin:$PATH" >> $GITHUB_ENV
- name: Debug log
run: |
pwd
ls -R
- name: Run FB Infer
id: fb-infer-run
if: ${{ steps.fb-infer-install.outcome == 'success' }}
run: |
infer run --compilation-database build/compile_commands.json
- name: Upload FB Infer Report
id: fb-infer-upload
if: ${{ steps.fb-infer-run.outcome == 'success' }}
uses: actions/upload-artifact@v4
with:
name: infer-report-diff-${{ github.head_ref }}
path: infer-out/report.*
if-no-files-found: error