Skip to content

Commit 5451f10

Browse files
author
M. Fatih Cırıt
committed
ci(build-and-test): extract the action and simplify
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> run on pr for testing Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> on push main Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> check out Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> rem check out from action Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> style(pre-commit): autofix fix action name Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> shell Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> fix container Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> fix machine type Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai> remove quotes and update the name Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
1 parent 565589c commit 5451f10

6 files changed

+154
-122
lines changed
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: build-and-test
2+
description: Reusable action for building and testing the repository
3+
inputs:
4+
build-depends-repos:
5+
description: Repositories for build dependencies
6+
required: true
7+
rosdistro:
8+
description: ROS distribution
9+
required: true
10+
11+
runs:
12+
using: composite
13+
steps:
14+
- name: Show disk space before the tasks
15+
shell: bash
16+
run: df -h
17+
18+
- name: Remove exec_depend
19+
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
20+
21+
- name: Get self packages
22+
id: get-self-packages
23+
uses: autowarefoundation/autoware-github-actions/get-self-packages@v1
24+
25+
- name: Build
26+
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
27+
uses: autowarefoundation/autoware-github-actions/colcon-build@v1
28+
with:
29+
rosdistro: ${{ inputs.rosdistro }}
30+
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
31+
build-depends-repos: ${{ inputs.build-depends-repos }}
32+
33+
- name: Test
34+
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
35+
id: test
36+
uses: autowarefoundation/autoware-github-actions/colcon-test@v1
37+
with:
38+
rosdistro: ${{ inputs.rosdistro }}
39+
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
40+
build-depends-repos: ${{ inputs.build-depends-repos }}
41+
42+
- name: Upload coverage to CodeCov
43+
if: ${{ steps.test.outputs.coverage-report-files != '' }}
44+
uses: codecov/codecov-action@v3
45+
with:
46+
files: ${{ steps.test.outputs.coverage-report-files }}
47+
fail_ci_if_error: false
48+
verbose: true
49+
flags: total
50+
51+
- name: Show disk space after the tasks
52+
shell: bash
53+
run: df -h

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

-55
This file was deleted.
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: build-and-test-cuda
2+
3+
on:
4+
pull_request:
5+
types: [opened, labeled, unlabeled, synchronize]
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build-and-test-cuda:
12+
runs-on: [self-hosted, linux, X64]
13+
container: ${{ matrix.container }}${{ matrix.container-suffix }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
rosdistro:
18+
- humble
19+
container-suffix:
20+
- -cuda
21+
include:
22+
- rosdistro: humble
23+
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt
24+
build-depends-repos: build_depends.repos
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v4
28+
29+
- name: Build and Test
30+
uses: ./.github/actions/build-and-test
31+
with:
32+
build-depends-repos: ${{ matrix.build-depends-repos }}
33+
rosdistro: ${{ matrix.rosdistro }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: build-and-test-daily-arm64
2+
3+
on:
4+
pull_request:
5+
types: [opened, labeled, unlabeled, synchronize]
6+
schedule:
7+
- cron: 0 0 * * *
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-test-daily-arm64:
12+
runs-on: [self-hosted, linux, ARM64]
13+
container: ${{ matrix.container }}${{ matrix.container-suffix }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
rosdistro:
18+
- humble
19+
container-suffix:
20+
- ""
21+
- -cuda
22+
include:
23+
- rosdistro: humble
24+
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt
25+
build-depends-repos: build_depends.repos
26+
steps:
27+
- name: Check out repository
28+
uses: actions/checkout@v4
29+
30+
- name: Build and Test
31+
uses: ./.github/actions/build-and-test
32+
with:
33+
build-depends-repos: ${{ matrix.build-depends-repos }}
34+
rosdistro: ${{ matrix.rosdistro }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: build-and-test-daily
2+
3+
on:
4+
pull_request:
5+
types: [opened, labeled, unlabeled, synchronize]
6+
schedule:
7+
- cron: 0 0 * * *
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-test-daily:
12+
runs-on: [self-hosted, linux, X64]
13+
container: ${{ matrix.container }}${{ matrix.container-suffix }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
rosdistro:
18+
- humble
19+
container-suffix:
20+
- ""
21+
- -cuda
22+
include:
23+
- rosdistro: humble
24+
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt
25+
build-depends-repos: build_depends.repos
26+
steps:
27+
- name: Check out repository
28+
uses: actions/checkout@v4
29+
30+
- name: Build and Test
31+
uses: ./.github/actions/build-and-test
32+
with:
33+
build-depends-repos: ${{ matrix.build-depends-repos }}
34+
rosdistro: ${{ matrix.rosdistro }}

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

-67
This file was deleted.

0 commit comments

Comments
 (0)