|
33 | 33 |
|
34 | 34 | jobs:
|
35 | 35 |
|
36 |
| - format: |
| 36 | + addlicense: |
| 37 | + name: verify liceses |
| 38 | + |
37 | 39 | runs-on: ubuntu-20.04
|
38 | 40 |
|
39 | 41 | steps:
|
40 | 42 | - uses: actions/checkout@v2
|
| 43 | + |
41 | 44 | - uses: actions/setup-go@v2
|
42 | 45 | with:
|
43 | 46 | go-version: '^1.16'
|
44 | 47 |
|
45 |
| - - name: Format (addlicense) |
| 48 | + - name: Install dependencies (Linux) |
46 | 49 | run: |
|
47 | 50 | go install github.com/google/addlicense@latest
|
48 |
| - export PATH=$PATH:$(go env GOPATH)/bin |
49 |
| - addlicense -check . |
| 51 | + echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" |
50 | 52 |
|
51 |
| - - name: Format (buildifier) |
| 53 | + - name: Format (addlicense) |
| 54 | + run: addlicense -check . |
| 55 | + |
| 56 | + buildifier: |
| 57 | + name: check format with buildifier |
| 58 | + |
| 59 | + runs-on: ubuntu-20.04 |
| 60 | + |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v2 |
| 63 | + |
| 64 | + - uses: actions/setup-go@v2 |
| 65 | + with: |
| 66 | + go-version: '^1.16' |
| 67 | + |
| 68 | + - name: Install dependencies (Linux) |
52 | 69 | run: |
|
53 | 70 | go install github.com/bazelbuild/buildtools/buildifier@latest
|
54 |
| - export PATH=$PATH:$(go env GOPATH)/bin |
55 |
| - find . -name "WORKSPACE" -o -name "*BUILD*" -o -name "*.bzl" | xargs -n1 buildifier -mode=check |
| 71 | + echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" |
| 72 | +
|
| 73 | + - name: Format (buildifier) |
| 74 | + run: find . -name "WORKSPACE" -o -name "*BUILD*" -o -name "*.bzl" | xargs -n1 buildifier -mode=check |
| 75 | + |
| 76 | + clang_format: |
| 77 | + name: check format with clang-format |
| 78 | + |
| 79 | + runs-on: ubuntu-20.04 |
| 80 | + |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v2 |
| 83 | + |
| 84 | + - name: Install dependencies (Linux) |
| 85 | + run: sudo apt-get install -y clang-format-12 |
56 | 86 |
|
57 | 87 | - name: Format (clang-format)
|
58 | 88 | run: |
|
59 |
| - sudo apt-get install -y clang-format-12 |
60 | 89 | find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-12 -i
|
61 | 90 | git diff --exit-code
|
62 | 91 |
|
63 |
| - - name: Format (clang-tidy) |
64 |
| - run: | |
65 |
| - sudo apt-get install -y clang-tidy-12 |
66 |
| - bazel build \ |
67 |
| - --config clang-tidy \ |
68 |
| - --define engine=multi \ |
69 |
| - --copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" \ |
| 92 | + clang_tidy: |
| 93 | + name: check format with clang-tidy |
| 94 | + |
| 95 | + runs-on: ubuntu-20.04 |
| 96 | + |
| 97 | + steps: |
| 98 | + - uses: actions/checkout@v2 |
| 99 | + |
| 100 | + - name: Install dependencies (Linux) |
| 101 | + run: sudo apt-get install -y clang-tidy-12 |
| 102 | + |
| 103 | + - name: Bazel cache |
| 104 | + uses: PiotrSikora/[email protected] |
| 105 | + with: |
| 106 | + path: | |
| 107 | + ~/.cache/bazel |
| 108 | + key: clang_tidy-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/dependencies.bzl', 'bazel/repositories.bzl', 'bazel/cargo/wasmsign/crates.bzl') }} |
| 109 | + |
| 110 | + - name: Bazel build |
| 111 | + run: > |
| 112 | + bazel build |
| 113 | + --config clang-tidy |
| 114 | + --define engine=multi |
| 115 | + --copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" |
70 | 116 | //...
|
71 | 117 |
|
| 118 | + - name: Skip Bazel cache update |
| 119 | + if: ${{ github.ref != 'refs/heads/master' }} |
| 120 | + run: echo "CACHE_SKIP_SAVE=true" >> $GITHUB_ENV |
| 121 | + |
| 122 | + - name: Cleanup Bazel cache |
| 123 | + if: ${{ github.ref == 'refs/heads/master' }} |
| 124 | + run: | |
| 125 | + export OUTPUT=$(${{ matrix.run_under }} bazel info output_base) |
| 126 | + echo "===== BEFORE =====" |
| 127 | + du -s ${OUTPUT}/external/* $(dirname ${OUTPUT})/* | sort -rn | head -20 |
| 128 | + # BoringSSL's test data (90 MiB). |
| 129 | + rm -rf ${OUTPUT}/external/boringssl/crypto_test_data.cc |
| 130 | + rm -rf ${OUTPUT}/external/boringssl/src/crypto/*/test/ |
| 131 | + rm -rf ${OUTPUT}/external/boringssl/src/third_party/wycheproof_testvectors/ |
| 132 | + # LLVM's tests (500 MiB). |
| 133 | + rm -rf ${OUTPUT}/external/llvm*/test/ |
| 134 | + # V8's tests (100 MiB). |
| 135 | + if [ -d "${OUTPUT}/external/v8/test/torque" ]; then |
| 136 | + mv ${OUTPUT}/external/v8/test/torque ${OUTPUT}/external/v8/test_torque |
| 137 | + rm -rf ${OUTPUT}/external/v8/test/* |
| 138 | + mv ${OUTPUT}/external/v8/test_torque ${OUTPUT}/external/v8/test/torque |
| 139 | + fi |
| 140 | + # Unnecessary CMake tools (65 MiB). |
| 141 | + rm -rf ${OUTPUT}/external/cmake-*/bin/{ccmake,cmake-gui,cpack,ctest} |
| 142 | + # Distfiles for Rust toolchains (350 MiB). |
| 143 | + rm -rf ${OUTPUT}/external/rust_*/*.tar.gz |
| 144 | + # Bazel's repository cache (650-800 MiB) and install base (155 MiB). |
| 145 | + rm -rf ${OUTPUT}/../cache |
| 146 | + rm -rf ${OUTPUT}/../install |
| 147 | + echo "===== AFTER =====" |
| 148 | + du -s ${OUTPUT}/external/* $(dirname ${OUTPUT})/* | sort -rn | head -20 |
| 149 | +
|
72 | 150 | test_data:
|
73 | 151 | name: build test data
|
74 | 152 |
|
|
0 commit comments