Skip to content

Commit

Permalink
ci(build-and-test): extract the action and simplify
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>

run on pr for testing

Signed-off-by: M. Fatih Cırıt <[email protected]>

on push main

Signed-off-by: M. Fatih Cırıt <[email protected]>

check out

Signed-off-by: M. Fatih Cırıt <[email protected]>

rem check out from action

Signed-off-by: M. Fatih Cırıt <[email protected]>

style(pre-commit): autofix

fix action name

Signed-off-by: M. Fatih Cırıt <[email protected]>

shell

Signed-off-by: M. Fatih Cırıt <[email protected]>

fix container

Signed-off-by: M. Fatih Cırıt <[email protected]>

fix machine type

Signed-off-by: M. Fatih Cırıt <[email protected]>

remove quotes and update the name

Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
M. Fatih Cırıt committed Jun 7, 2024
1 parent 565589c commit 5451f10
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 122 deletions.
53 changes: 53 additions & 0 deletions .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: build-and-test
description: Reusable action for building and testing the repository
inputs:
build-depends-repos:
description: Repositories for build dependencies
required: true
rosdistro:
description: ROS distribution
required: true

runs:
using: composite
steps:
- name: Show disk space before the tasks
shell: bash
run: df -h

- name: Remove exec_depend
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1

- name: Get self packages
id: get-self-packages
uses: autowarefoundation/autoware-github-actions/get-self-packages@v1

- name: Build
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-build@v1
with:
rosdistro: ${{ inputs.rosdistro }}
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
build-depends-repos: ${{ inputs.build-depends-repos }}

- name: Test
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
id: test
uses: autowarefoundation/autoware-github-actions/colcon-test@v1
with:
rosdistro: ${{ inputs.rosdistro }}
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
build-depends-repos: ${{ inputs.build-depends-repos }}

- name: Upload coverage to CodeCov
if: ${{ steps.test.outputs.coverage-report-files != '' }}
uses: codecov/codecov-action@v3
with:
files: ${{ steps.test.outputs.coverage-report-files }}
fail_ci_if_error: false
verbose: true
flags: total

- name: Show disk space after the tasks
shell: bash
run: df -h
55 changes: 0 additions & 55 deletions .github/workflows/build-and-test-arm64.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/build-and-test-cuda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build-and-test-cuda

on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
push:
branches:
- main

jobs:
build-and-test-cuda:
runs-on: [self-hosted, linux, X64]
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
matrix:
rosdistro:
- humble
container-suffix:
- -cuda
include:
- rosdistro: humble
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt
build-depends-repos: build_depends.repos
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Build and Test
uses: ./.github/actions/build-and-test
with:
build-depends-repos: ${{ matrix.build-depends-repos }}
rosdistro: ${{ matrix.rosdistro }}
34 changes: 34 additions & 0 deletions .github/workflows/build-and-test-daily-arm64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build-and-test-daily-arm64

on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
build-and-test-daily-arm64:
runs-on: [self-hosted, linux, ARM64]
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
matrix:
rosdistro:
- humble
container-suffix:
- ""
- -cuda
include:
- rosdistro: humble
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt
build-depends-repos: build_depends.repos
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Build and Test
uses: ./.github/actions/build-and-test
with:
build-depends-repos: ${{ matrix.build-depends-repos }}
rosdistro: ${{ matrix.rosdistro }}
34 changes: 34 additions & 0 deletions .github/workflows/build-and-test-daily.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build-and-test-daily

on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
build-and-test-daily:
runs-on: [self-hosted, linux, X64]
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
matrix:
rosdistro:
- humble
container-suffix:
- ""
- -cuda
include:
- rosdistro: humble
container: ghcr.io/autowarefoundation/autoware:latest-prebuilt
build-depends-repos: build_depends.repos
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Build and Test
uses: ./.github/actions/build-and-test
with:
build-depends-repos: ${{ matrix.build-depends-repos }}
rosdistro: ${{ matrix.rosdistro }}
67 changes: 0 additions & 67 deletions .github/workflows/build-and-test.yaml

This file was deleted.

0 comments on commit 5451f10

Please sign in to comment.