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