-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (120 loc) · 4.5 KB
/
BuildTest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: BuildTest
on:
schedule:
- cron: 0 0 * * *
pull_request:
workflow_dispatch:
jobs:
build:
name: build
runs-on: ubuntu-22.04
timeout-minutes: 180
strategy:
fail-fast: false
max-parallel: 8
matrix:
rosdistro: [humble]
include:
# Galactic Geochelone (May 2021 - November 2022)
# - docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-galactic-ros-base-latest
# rosdistro: galactic
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
rosdistro: humble
# Rolling Ridley
# - docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest
# rosdistro: rolling
env:
ROS_DISTRO: ${{ matrix.rosdistro }}
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: workaround for jammy
if: ${{ matrix.rosdistro == 'humble' }}
run: |
apt remove libunwind-14-dev -y
apt install python3-nose -y
pip uninstall nose -y
- name: install ccache
run: |
apt install -y ccache
- name: Make ccache dir
run: |
mkdir -p /tmp/ccache
- uses: actions/cache@v3
with:
path: /tmp/ccache
key: ccache-${{ matrix.rosdistro }}
- name: Search packages in this repository
id: list_packages
run: |
echo ::set-output name=package_list::$(colcon list --names-only | sed -e ':loop; N; $!b loop; s/\n/ /g')
- name: Show target packages
run: |
echo "Target packages: ${{ steps.list_packages.outputs.package_list }}"
- name: Check dependency-${{ matrix.rosdistro }}.repos existence
id: check_rosdistro_repos_files
uses: andstor/file-existence-action@v1
with:
files: dependency-${{ matrix.rosdistro }}.repos
allow_failure: false
- name: Check dependency.repos existence
id: check_repos_files
uses: andstor/file-existence-action@v1
with:
files: dependency.repos
allow_failure: false
- name: Run build test with dependency-${{ matrix.rosdistro }}.repos
uses: ros-tooling/action-ros-ci@v0.3
if: steps.check_rosdistro_repos_files.outputs.files_exists == 'true'
with:
package-name: ${{ steps.list_packages.outputs.package_list }}
target-ros2-distro: ${{ matrix.rosdistro }}
vcs-repo-file-url: dependency-${{ matrix.rosdistro }}.repos
extra-cmake-args: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
CCACHE_DIR: /tmp/ccache
DEVELOP: true
- name: Run build test with dependency.repos
uses: ros-tooling/action-ros-ci@v0.3
if: steps.check_rosdistro_repos_files.outputs.files_exists == 'false' && steps.check_repos_files.outputs.files_exists == 'true'
with:
package-name: ${{ steps.list_packages.outputs.package_list }}
target-ros2-distro: ${{ matrix.rosdistro }}
vcs-repo-file-url: dependency.repos
extra-cmake-args: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
CCACHE_DIR: /tmp/ccache
DEVELOP: true
- name: Run build test without .repos file
uses: ros-tooling/action-ros-ci@v0.3
if: steps.check_rosdistro_repos_files.outputs.files_exists == 'false' && steps.check_repos_files.outputs.files_exists == 'false'
with:
package-name: ${{ steps.list_packages.outputs.package_list }}
target-ros2-distro: ${{ matrix.rosdistro }}
extra-cmake-args: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
CCACHE_DIR: /tmp/ccache
DEVELOP: true
- name: Notify Slack
uses: 8398a7/action-slack@v2
if: failure()
with:
status: ${{ job.status }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
merge:
name: merge
runs-on: ubuntu-22.04
timeout-minutes: 180
needs: build
steps:
- name: merge PR
if : ${{ (github.event_name == 'pull_request') && (github.actor == 'wam-v-tan') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr merge ${{ github.event.pull_request.html_url }} --merge