|
31 | 31 | schedule: |
32 | 32 | - cron: '0 0 * * *' |
33 | 33 |
|
| 34 | + workflow_dispatch: |
| 35 | + |
34 | 36 | concurrency: |
35 | 37 |
|
36 | 38 | group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }} |
|
41 | 43 | addlicense: |
42 | 44 | name: verify licenses |
43 | 45 |
|
44 | | - runs-on: ubuntu-20.04 |
| 46 | + runs-on: ubuntu-24.04-16core |
45 | 47 |
|
46 | 48 | steps: |
47 | 49 | - uses: actions/checkout@v2 |
|
61 | 63 | buildifier: |
62 | 64 | name: check format with buildifier |
63 | 65 |
|
64 | | - runs-on: ubuntu-20.04 |
| 66 | + runs-on: ubuntu-24.04-16core |
65 | 67 |
|
66 | 68 | steps: |
67 | 69 | - uses: actions/checkout@v2 |
@@ -99,73 +101,64 @@ jobs: |
99 | 101 | clang_format: |
100 | 102 | name: check format with clang-format |
101 | 103 |
|
102 | | - runs-on: ubuntu-20.04 |
| 104 | + runs-on: ubuntu-24.04-16core |
103 | 105 |
|
104 | 106 | steps: |
105 | 107 | - uses: actions/checkout@v2 |
106 | 108 |
|
107 | 109 | - name: Install dependencies (Linux) |
108 | | - run: sudo apt update -y && sudo apt install -y clang-format-12 |
| 110 | + run: sudo apt update -y && sudo apt install -y clang-format-18 |
109 | 111 |
|
110 | 112 | - name: Format (clang-format) |
111 | 113 | run: | |
112 | | - find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-12 -i |
| 114 | + find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-18 -i |
113 | 115 | git diff --exit-code |
114 | 116 |
|
115 | 117 | clang_tidy: |
116 | 118 | name: check format with clang-tidy |
117 | 119 |
|
118 | | - runs-on: ubuntu-20.04 |
| 120 | + runs-on: ubuntu-24.04-16core |
119 | 121 |
|
120 | 122 | steps: |
121 | 123 | - uses: actions/checkout@v2 |
122 | 124 |
|
123 | 125 | - name: Install dependencies (Linux) |
124 | | - run: sudo apt update -y && sudo apt install -y clang-tidy-12 lld-12 && sudo ln -sf /usr/bin/lld-12 /usr/bin/lld |
125 | | - |
126 | | - - name: Bazel cache |
127 | | - uses: PiotrSikora/cache@v2.1.7-with-skip-cache |
| 126 | + run: sudo apt update -y && sudo apt install -y clang-tidy-18 lld-18 && sudo ln -sf /usr/bin/lld-18 /usr/bin/lld |
| 127 | + |
| 128 | + - name: set cache name |
| 129 | + id: vars |
| 130 | + # The cache tag consists of the following parts: |
| 131 | + # * clang-tidy- prefix |
| 132 | + # * matrix.name, which separates the cache for each build type. |
| 133 | + # * hash of WORKSPACE, .bazelrc, and .bazelversion, which is |
| 134 | + # purely to differentiate caches for substantial changes in bazel. |
| 135 | + # * github.sha, which is the commit hash of the commit used to generate |
| 136 | + # the cache entry. |
| 137 | + run: echo "CACHE_TAG=clang-tidy-${{ matrix.name }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT" |
| 138 | + |
| 139 | + - name: bazel cache |
| 140 | + uses: actions/cache/restore@v3 |
128 | 141 | with: |
129 | | - path: | |
130 | | - ~/.cache/bazel |
131 | | - key: clang_tidy-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/dependencies.bzl', 'bazel/repositories.bzl', 'bazel/cargo/wasmsign/remote/crates.bzl') }} |
| 142 | + path: /tmp/bazel/cache |
| 143 | + key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} |
| 144 | + restore-keys: | |
| 145 | + ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} |
| 146 | + ${{ steps.vars.outputs.CACHE_TAG }}- |
| 147 | + clang-tidy-${{ matrix.name }}- |
| 148 | + clang-tidy- |
132 | 149 |
|
133 | 150 | - name: Bazel build |
134 | 151 | run: > |
135 | 152 | bazel build |
136 | 153 | --config clang-tidy |
137 | 154 | --define engine=multi |
| 155 | + --disk_cache /tmp/bazel/cache |
138 | 156 | --copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" |
139 | 157 | //... |
140 | 158 |
|
141 | | - - name: Skip Bazel cache update |
142 | | - if: ${{ github.ref != 'refs/heads/main' }} |
143 | | - run: echo "CACHE_SKIP_SAVE=true" >> $GITHUB_ENV |
144 | | - |
145 | | - - name: Cleanup Bazel cache |
146 | | - if: ${{ github.ref == 'refs/heads/main' }} |
147 | | - run: | |
148 | | - export OUTPUT=$(${{ matrix.run_under }} bazel info output_base) |
149 | | - echo "===== BEFORE =====" |
150 | | - du -s ${OUTPUT}/external/* $(dirname ${OUTPUT})/* | sort -rn | head -20 |
151 | | - # BoringSSL's test data (90 MiB). |
152 | | - rm -rf ${OUTPUT}/external/boringssl/crypto_test_data.cc |
153 | | - rm -rf ${OUTPUT}/external/boringssl/src/crypto/*/test/ |
154 | | - rm -rf ${OUTPUT}/external/boringssl/src/third_party/wycheproof_testvectors/ |
155 | | - # LLVM's tests (500 MiB). |
156 | | - rm -rf ${OUTPUT}/external/llvm*/test/ |
157 | | - # V8's tests (100 MiB). |
158 | | - if [ -d "${OUTPUT}/external/v8/test/torque" ]; then |
159 | | - mv ${OUTPUT}/external/v8/test/torque ${OUTPUT}/external/v8/test_torque |
160 | | - rm -rf ${OUTPUT}/external/v8/test/* |
161 | | - mv ${OUTPUT}/external/v8/test_torque ${OUTPUT}/external/v8/test/torque |
162 | | - fi |
163 | | - # Unnecessary CMake tools (65 MiB). |
164 | | - rm -rf ${OUTPUT}/external/cmake-*/bin/{ccmake,cmake-gui,cpack,ctest} |
165 | | - # Distfiles for Rust toolchains (350 MiB). |
166 | | - rm -rf ${OUTPUT}/external/rust_*/*.tar.gz |
167 | | - # Bazel's repository cache (650-800 MiB) and install base (155 MiB). |
168 | | - rm -rf ${OUTPUT}/../cache |
169 | | - rm -rf ${OUTPUT}/../install |
170 | | - echo "===== AFTER =====" |
171 | | - du -s ${OUTPUT}/external/* $(dirname ${OUTPUT})/* | sort -rn | head -20 |
| 159 | + - name: save bazel cache |
| 160 | + uses: actions/cache/save@v3 |
| 161 | + if: always() |
| 162 | + with: |
| 163 | + path: /tmp/bazel/cache |
| 164 | + key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} |
0 commit comments