Skip to content

Commit 7c3acad

Browse files
committed
health check
Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
1 parent f201340 commit 7c3acad

1 file changed

Lines changed: 174 additions & 0 deletions

File tree

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: health-check-new
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- labeled
10+
schedule:
11+
- cron: 0 12 * * *
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
label-check:
20+
uses: autowarefoundation/autoware-github-actions/.github/workflows/make-sure-label-is-present.yaml@v1
21+
with:
22+
label: run:health-check-new
23+
24+
docker-build:
25+
needs: label-check
26+
if: ${{ needs.label-check.outputs.result == 'true' ||
27+
github.event_name == 'schedule' ||
28+
github.event_name == 'workflow_dispatch' }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
build-type: [main, nightly, main-arm64]
33+
include:
34+
- build-type: main
35+
platform: amd64
36+
runner: "['self-hosted','Linux','X64']"
37+
- build-type: nightly
38+
platform: amd64
39+
runner: "['ubuntu-24.04']"
40+
- build-type: main-arm64
41+
platform: arm64
42+
runner: "['ubuntu-24.04-arm']"
43+
runs-on: ${{ fromJson(matrix.runner) }}
44+
steps:
45+
- name: "🔧 Change permission of workspace"
46+
run: |
47+
sudo rm -rf ${{ github.workspace }}/scenario_out
48+
sudo chown -R $USER:$USER ${{ github.workspace }}
49+
50+
- name: "📥 Check out repository"
51+
uses: actions/checkout@v6
52+
53+
- name: "📂 Get changed files"
54+
id: changed-files
55+
uses: step-security/changed-files@v47
56+
with:
57+
files: |
58+
repositories/*.repos
59+
.github/workflows/health-check-new.yaml
60+
ansible-galaxy-requirements.yaml
61+
ansible/**
62+
docker-new/**
63+
64+
- name: "💻 Runner specs"
65+
run: |
66+
echo "::group::CPU"
67+
lscpu | grep -E "^(Architecture|CPU\(s\)|Model name|Thread|Core|Socket)"
68+
echo "::endgroup::"
69+
echo "::group::Memory"
70+
free -h
71+
echo "::endgroup::"
72+
echo "::group::Disk"
73+
df -h /
74+
echo "::endgroup::"
75+
76+
- name: "🧹 Free disk space"
77+
if: ${{ matrix.build-type != 'main' &&
78+
(steps.changed-files.outputs.any_changed == 'true' ||
79+
github.event_name == 'schedule' ||
80+
github.event_name == 'workflow_dispatch') }}
81+
uses: ./.github/actions/free-disk-space
82+
83+
- name: "💾 Create additional swap"
84+
if: ${{ matrix.platform == 'arm64' &&
85+
(steps.changed-files.outputs.any_changed == 'true' ||
86+
github.event_name == 'schedule' ||
87+
github.event_name == 'workflow_dispatch') }}
88+
run: |
89+
sudo fallocate -l 8G /mnt/swapfile
90+
sudo chmod 600 /mnt/swapfile
91+
sudo mkswap /mnt/swapfile
92+
sudo swapon /mnt/swapfile
93+
free -h
94+
95+
- name: "📦 Import source repos"
96+
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
97+
github.event_name == 'schedule' ||
98+
github.event_name == 'workflow_dispatch' }}
99+
run: |
100+
pipx install vcs2l
101+
mkdir -p src
102+
vcs import --shallow src < repositories/autoware.repos
103+
104+
- name: "📦 Overlay nightly repos"
105+
if: ${{ matrix.build-type == 'nightly' &&
106+
(steps.changed-files.outputs.any_changed == 'true' ||
107+
github.event_name == 'schedule' ||
108+
github.event_name == 'workflow_dispatch') }}
109+
run: |
110+
vcs import --shallow --force src < repositories/autoware-nightly.repos
111+
112+
- name: "🐳 Setup Docker Buildx"
113+
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
114+
github.event_name == 'schedule' ||
115+
github.event_name == 'workflow_dispatch' }}
116+
uses: docker/setup-buildx-action@v4
117+
with:
118+
buildkitd-config-inline: |
119+
[worker.oci]
120+
max-parallelism = 2
121+
122+
- name: "🔑 Login to GitHub Container Registry"
123+
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
124+
github.event_name == 'schedule' ||
125+
github.event_name == 'workflow_dispatch' }}
126+
uses: docker/login-action@v4
127+
with:
128+
registry: ghcr.io
129+
username: ${{ github.repository_owner }}
130+
password: ${{ github.token }}
131+
132+
- name: "🔨 Build Autoware (docker-new)"
133+
if: ${{ steps.changed-files.outputs.any_changed == 'true' ||
134+
github.event_name == 'schedule' ||
135+
github.event_name == 'workflow_dispatch' }}
136+
uses: docker/bake-action@v7
137+
env:
138+
ROS_DISTRO: humble
139+
with:
140+
source: .
141+
targets: universe-devel
142+
files: docker-new/docker-bake.hcl
143+
load: true
144+
provenance: false
145+
set: |
146+
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache-new:${{ matrix.platform }}-main
147+
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache-new:${{ matrix.build-type }}-${{ matrix.platform }}-main
148+
149+
- name: "💾 Save Docker image"
150+
if: ${{ matrix.build-type == 'main' &&
151+
(steps.changed-files.outputs.any_changed == 'true' ||
152+
github.event_name == 'schedule' ||
153+
github.event_name == 'workflow_dispatch') }}
154+
run: docker save autoware:universe-devel-humble | gzip > /tmp/autoware-image.tar.gz
155+
156+
- name: "📤 Upload Docker image artifact"
157+
if: ${{ matrix.build-type == 'main' &&
158+
(steps.changed-files.outputs.any_changed == 'true' ||
159+
github.event_name == 'schedule' ||
160+
github.event_name == 'workflow_dispatch') }}
161+
uses: actions/upload-artifact@v7
162+
with:
163+
name: autoware-image
164+
path: /tmp/autoware-image.tar.gz
165+
166+
- name: "📊 Disk space"
167+
if: always()
168+
run: df -h
169+
170+
scenario-test:
171+
needs: docker-build
172+
uses: ./.github/workflows/scenario-test-reusable.yaml
173+
with:
174+
autoware_container_image: autoware:universe-devel-humble

0 commit comments

Comments
 (0)