Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit ef600d8

Browse files
author
M. Fatih Cırıt
committed
ci: overhaul build-and-test derivatives and split clang-tidy
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
1 parent f01d31c commit ef600d8

5 files changed

+185
-44
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: build-and-test-differential
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
prevent-no-label-execution:
8+
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
9+
with:
10+
label: tag:run-build-and-test-differential
11+
12+
build-and-test-differential:
13+
needs: prevent-no-label-execution
14+
runs-on: ubuntu-latest
15+
container: ${{ matrix.container }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
rosdistro:
20+
- humble
21+
include:
22+
- rosdistro: humble
23+
container: ros:humble
24+
build-depends-repos: build_depends.repos
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 1
30+
31+
- name: Show disk space before the tasks
32+
run: df -h
33+
34+
- name: Remove exec_depend
35+
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
36+
37+
- name: Get modified packages
38+
id: get-modified-packages
39+
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
40+
41+
- name: Build
42+
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
43+
uses: autowarefoundation/autoware-github-actions/colcon-build@v1
44+
with:
45+
rosdistro: ${{ matrix.rosdistro }}
46+
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
47+
build-depends-repos: ${{ matrix.build-depends-repos }}
48+
49+
- name: Test
50+
id: test
51+
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
52+
uses: autowarefoundation/autoware-github-actions/colcon-test@v1
53+
with:
54+
rosdistro: ${{ matrix.rosdistro }}
55+
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
56+
build-depends-repos: ${{ matrix.build-depends-repos }}
57+
58+
- name: Upload coverage to CodeCov
59+
if: ${{ steps.test.outputs.coverage-report-files != '' }}
60+
uses: codecov/codecov-action@v3
61+
with:
62+
files: ${{ steps.test.outputs.coverage-report-files }}
63+
fail_ci_if_error: false
64+
verbose: true
65+
flags: differential
66+
67+
- name: Show disk space after the tasks
68+
run: df -h

.github/workflows/build-and-test-differential.yaml

+7-36
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ jobs:
1818
build-depends-repos: build_depends.repos
1919
steps:
2020
- name: Check out repository
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222
with:
23-
fetch-depth: 0
23+
fetch-depth: 1
24+
25+
- name: Show disk space before the tasks
26+
run: df -h
2427

2528
- name: Remove exec_depend
2629
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
@@ -55,37 +58,5 @@ jobs:
5558
verbose: true
5659
flags: differential
5760

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@v3
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
61+
- name: Show disk space after the tasks
62+
run: df -h

.github/workflows/build-and-test.yaml

+5-8
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ jobs:
2222
build-depends-repos: build_depends.repos
2323
steps:
2424
- name: Check out repository
25-
uses: actions/checkout@v3
26-
27-
- name: Free disk space (Ubuntu)
28-
uses: jlumbroso/free-disk-space@v1.3.1
25+
uses: actions/checkout@v4
2926
with:
30-
tool-cache: false
31-
dotnet: false
32-
swap-storage: false
33-
large-packages: false
27+
fetch-depth: 1
28+
29+
- name: Show disk space before the tasks
30+
run: df -h
3431

3532
- name: Remove exec_depend
3633
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: clang-tidy-differential
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- labeled
9+
10+
jobs:
11+
prevent-no-label-execution:
12+
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
13+
with:
14+
label: tag:run-clang-tidy-differential
15+
16+
clang-tidy-differential:
17+
needs: prevent-no-label-execution
18+
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
19+
runs-on: ubuntu-latest
20+
container: ros:humble
21+
steps:
22+
- name: Check out repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Show disk space before the tasks
28+
run: df -h
29+
30+
- name: Remove exec_depend
31+
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
32+
33+
- name: Get modified packages
34+
id: get-modified-packages
35+
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
36+
37+
- name: Get modified files
38+
id: get-modified-files
39+
uses: tj-actions/changed-files@v42
40+
with:
41+
files: |
42+
**/*.cpp
43+
**/*.hpp
44+
45+
- name: Run clang-tidy
46+
if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
47+
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
48+
with:
49+
rosdistro: humble
50+
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
51+
target-files: ${{ steps.get-modified-files.outputs.all_changed_files }}
52+
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
53+
build-depends-repos: build_depends.repos
54+
55+
- name: Show disk space after the tasks
56+
run: df -h
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: clang-tidy-differential
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- labeled
9+
10+
jobs:
11+
clang-tidy-differential:
12+
runs-on: ubuntu-latest
13+
container: ros:humble
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Show disk space before the tasks
21+
run: df -h
22+
23+
- name: Remove exec_depend
24+
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
25+
26+
- name: Get modified packages
27+
id: get-modified-packages
28+
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1
29+
30+
- name: Get modified files
31+
id: get-modified-files
32+
uses: tj-actions/changed-files@v42
33+
with:
34+
files: |
35+
**/*.cpp
36+
**/*.hpp
37+
38+
- name: Run clang-tidy
39+
if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }}
40+
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
41+
with:
42+
rosdistro: humble
43+
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
44+
target-files: ${{ steps.get-modified-files.outputs.all_changed_files }}
45+
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
46+
build-depends-repos: build_depends.repos
47+
48+
- name: Show disk space after the tasks
49+
run: df -h

0 commit comments

Comments
 (0)