Skip to content

build: improve caching. #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,42 +68,60 @@ jobs:
include:
- name: 'V8 on Linux/x86_64'
runtime: 'v8'
repo: 'v8'
os: ubuntu-20.04
arch: x86_64
action: test
flags: '--define crypto=system'
- name: 'V8 on macOS/x86_64'
runtime: 'v8'
repo: 'v8'
os: macos-11
arch: x86_64
action: test
- name: 'WAMR on Linux/x86_64'
runtime: 'wamr'
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
os: ubuntu-20.04
arch: x86_64
action: test
- name: 'WAMR on macOS/x86_64'
runtime: 'wamr'
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
os: macos-11
arch: x86_64
action: test
- name: 'Wasmtime on Linux/x86_64'
runtime: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-20.04
arch: x86_64
action: test
- name: 'Wasmtime on Linux/aarch64'
runtime: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-20.04
arch: aarch64
action: build
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/arm64 piotrsikora/build-tools:bazel-4.2.2-clang-13-gcc-11
- name: 'Wasmtime on Linux/s390x'
runtime: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-20.04
arch: s390x
action: build
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x piotrsikora/build-tools:bazel-4.2.2-clang-13-gcc-11
- name: 'Wasmtime on macOS/x86_64'
runtime: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: macos-11
arch: x86_64
action: test
- name: 'WAVM on Linux/x86_64'
runtime: 'wavm'
repo: 'com_github_wavm_wavm'
os: ubuntu-20.04
arch: x86_64
action: test

steps:
Expand All @@ -121,14 +139,21 @@ jobs:
if: startsWith(matrix.run_under, 'docker')
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

- name: Set cache key
id: cache-key
run: echo "::set-output name=uniq::$(bazel query --output build //external:${{ matrix.repo }} | grep -E 'sha256|commit' | cut -d\" -f2)"

- name: Bazel cache
if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }}
uses: actions/cache@v2
with:
path: |
~/.cache/bazel
/private/var/tmp/_bazel_runner/
key: bazel-${{ matrix.os }}-${{ matrix.runtime }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
key: ${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }}-${{ steps.cache-key.outputs.uniq }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
restore-keys: |
${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }}-${{ steps.cache-key.outputs.uniq }}-
${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.runtime }}

- name: Bazel build/test
run: >
Expand Down