1
+ # This file is automatically synced from:
2
+ # https://github.com/autowarefoundation/sync-file-templates
3
+ # To make changes, update the source repository and follow the guidelines in its README.
4
+
1
5
name : build-and-test-differential
2
6
3
7
on :
4
8
pull_request :
9
+ types :
10
+ - opened
11
+ - synchronize
12
+ - reopened
13
+ - labeled
5
14
6
15
jobs :
16
+ make-sure-label-is-present :
17
+ uses : autowarefoundation/autoware-github-actions/.github/workflows/make-sure-label-is-present.yaml@v1
18
+ with :
19
+ label : run:build-and-test-differential
20
+
7
21
build-and-test-differential :
8
- runs-on : ubuntu-latest
22
+ needs : make-sure-label-is-present
23
+ if : ${{ needs.make-sure-label-is-present.outputs.result == 'true' }}
24
+ runs-on : ubuntu-22.04
9
25
container : ${{ matrix.container }}
10
26
strategy :
11
27
fail-fast : false
@@ -15,12 +31,18 @@ jobs:
15
31
include :
16
32
- rosdistro : humble
17
33
container : ros:humble
18
- build-depends-repos : build_depends.repos
19
34
steps :
20
- - name : Check out repository
35
+ - name : Set PR fetch depth
36
+ run : echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
37
+
38
+ - name : Checkout PR branch and all PR commits
21
39
uses : actions/checkout@v4
22
40
with :
23
- fetch-depth : 0
41
+ ref : ${{ github.event.pull_request.head.sha }}
42
+ fetch-depth : ${{ env.PR_FETCH_DEPTH }}
43
+
44
+ - name : Show disk space before the tasks
45
+ run : df -h
24
46
25
47
- name : Remove exec_depend
26
48
uses : autowarefoundation/autoware-github-actions/remove-exec-depend@v1
35
57
with :
36
58
rosdistro : ${{ matrix.rosdistro }}
37
59
target-packages : ${{ steps.get-modified-packages.outputs.modified-packages }}
38
- build-depends-repos : ${{ matrix.build-depends-repos }}
39
60
40
61
- name : Test
41
62
id : test
@@ -44,49 +65,15 @@ jobs:
44
65
with :
45
66
rosdistro : ${{ matrix.rosdistro }}
46
67
target-packages : ${{ steps.get-modified-packages.outputs.modified-packages }}
47
- build-depends-repos : ${{ matrix.build-depends-repos }}
48
68
49
69
- name : Upload coverage to CodeCov
50
70
if : ${{ steps.test.outputs.coverage-report-files != '' }}
51
- uses : codecov/codecov-action@v4
71
+ uses : codecov/codecov-action@v5
52
72
with :
53
73
files : ${{ steps.test.outputs.coverage-report-files }}
54
74
fail_ci_if_error : false
55
75
verbose : true
56
76
flags : differential
57
- token : ${{ secrets.CODECOV_TOKEN }}
58
-
59
- clang-tidy-differential :
60
- runs-on : ubuntu-latest
61
- container : ros:humble
62
- needs : build-and-test-differential
63
- steps :
64
- - name : Check out repository
65
- uses : actions/checkout@v4
66
- with :
67
- fetch-depth : 0
68
77
69
- - name : Remove exec_depend
70
- uses : autowarefoundation/autoware-github-actions/remove-exec-depend@v1
71
-
72
- - name : Get modified packages
73
- id : get-modified-packages
74
- uses : autowarefoundation/autoware-github-actions/get-modified-packages@v1
75
-
76
- - name : Get modified files
77
- id : get-modified-files
78
- uses : tj-actions/changed-files@v45
79
- with :
80
- files : |
81
- **/*.cpp
82
- **/*.hpp
83
-
84
- - name : Run clang-tidy
85
- if : ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
86
- uses : autowarefoundation/autoware-github-actions/clang-tidy@v1
87
- with :
88
- rosdistro : humble
89
- target-packages : ${{ steps.get-modified-packages.outputs.modified-packages }}
90
- target-files : ${{ steps.get-modified-files.outputs.all_changed_files }}
91
- clang-tidy-config-url : https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
92
- build-depends-repos : build_depends.repos
78
+ - name : Show disk space after the tasks
79
+ run : df -h
0 commit comments