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