Skip to content

Commit ad1ee47

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

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

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

+32-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
build-and-test-daily:
10-
runs-on: [self-hosted, linux, X64, gpu]
10+
runs-on: [self-hosted, Linux, X64]
1111
container: ${{ matrix.container }}${{ matrix.container-suffix }}
1212
strategy:
1313
fail-fast: false
@@ -37,6 +37,33 @@ jobs:
3737
id: get-self-packages
3838
uses: autowarefoundation/autoware-github-actions/get-self-packages@v1
3939

40+
- name: Create ccache directory
41+
run: |
42+
mkdir -p ${CCACHE_DIR}
43+
du -sh ${CCACHE_DIR} && ccache -s
44+
shell: bash
45+
46+
- name: Attempt to restore ccache
47+
uses: actions/cache/restore@v4
48+
with:
49+
path: |
50+
/root/.ccache
51+
key: ccache-main-${{ runner.arch }}-${{ matrix.rosdistro }}-${{ github.sha }}
52+
restore-keys: |
53+
ccache-main-${{ runner.arch }}-${{ matrix.rosdistro }}-
54+
55+
- name: Limit ccache size
56+
run: |
57+
rm -f "${CCACHE_DIR}/ccache.conf"
58+
echo -e "# Set maximum cache size\nmax_size = 600MB" >> "${CCACHE_DIR}/ccache.conf"
59+
shell: bash
60+
61+
- name: Show ccache stats before build and reset stats
62+
run: |
63+
du -sh ${CCACHE_DIR} && ccache -s
64+
ccache --zero-stats
65+
shell: bash
66+
4067
- name: Export CUDA state as a variable for adding to cache key
4168
run: |
4269
build_type_cuda_state=nocuda
@@ -56,6 +83,10 @@ jobs:
5683
build-depends-repos: ${{ matrix.build-depends-repos }}
5784
cache-key-element: ${{ env.BUILD_TYPE_CUDA_STATE }}
5885

86+
- name: Show ccache stats after build
87+
run: du -sh ${CCACHE_DIR} && ccache -s
88+
shell: bash
89+
5990
- name: Test
6091
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
6192
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)