Skip to content

Commit 8ba1699

Browse files
authored
ci(build-and-test): use self hosted X64 and add ccache to -daily (#9601)
Signed-off-by: M. Fatih Cırıt <mfc@autoware.org>
1 parent c0c70cc commit 8ba1699

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

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

+39-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ on:
55
- cron: 0 0 * * *
66
workflow_dispatch:
77

8+
env:
9+
CC: /usr/lib/ccache/gcc
10+
CXX: /usr/lib/ccache/g++
11+
812
jobs:
913
build-and-test-daily:
10-
runs-on: [self-hosted, linux, X64, gpu]
14+
runs-on: [self-hosted, Linux, X64]
1115
container: ${{ matrix.container }}${{ matrix.container-suffix }}
1216
strategy:
1317
fail-fast: false
@@ -30,13 +34,43 @@ jobs:
3034
- name: Show disk space before the tasks
3135
run: df -h
3236

37+
- name: Show machine specs
38+
run: lscpu && free -h
39+
3340
- name: Remove exec_depend
3441
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
3542

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

47+
- name: Create ccache directory
48+
run: |
49+
mkdir -p ${CCACHE_DIR}
50+
du -sh ${CCACHE_DIR} && ccache -s
51+
shell: bash
52+
53+
- name: Attempt to restore ccache
54+
uses: actions/cache/restore@v4
55+
with:
56+
path: |
57+
/root/.ccache
58+
key: ccache-main-${{ runner.arch }}-${{ matrix.rosdistro }}-${{ github.sha }}
59+
restore-keys: |
60+
ccache-main-${{ runner.arch }}-${{ matrix.rosdistro }}-
61+
62+
- name: Limit ccache size
63+
run: |
64+
rm -f "${CCACHE_DIR}/ccache.conf"
65+
echo -e "# Set maximum cache size\nmax_size = 600MB" >> "${CCACHE_DIR}/ccache.conf"
66+
shell: bash
67+
68+
- name: Show ccache stats before build and reset stats
69+
run: |
70+
du -sh ${CCACHE_DIR} && ccache -s
71+
ccache --zero-stats
72+
shell: bash
73+
4074
- name: Export CUDA state as a variable for adding to cache key
4175
run: |
4276
build_type_cuda_state=nocuda
@@ -56,6 +90,10 @@ jobs:
5690
build-depends-repos: ${{ matrix.build-depends-repos }}
5791
cache-key-element: ${{ env.BUILD_TYPE_CUDA_STATE }}
5892

93+
- name: Show ccache stats after build
94+
run: du -sh ${CCACHE_DIR} && ccache -s
95+
shell: bash
96+
5997
- name: Test
6098
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
6199
id: test

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
build-and-test:
19-
runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large
19+
runs-on: [self-hosted, Linux, X64]
2020
container: ${{ matrix.container }}${{ matrix.container-suffix }}
2121
strategy:
2222
fail-fast: false

0 commit comments

Comments
 (0)