From a375ab29769a801d785085b179a0c201298a0b62 Mon Sep 17 00:00:00 2001 From: OlivierDehaene <23298448+OlivierDehaene@users.noreply.github.com> Date: Fri, 3 Mar 2023 11:42:57 +0100 Subject: [PATCH] feat(ci): add sccache --- .github/workflows/tests.yaml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8b659fe2..8c650cc1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,6 +3,7 @@ name: Server Tests on: pull_request: paths: + - ".github/workflows/tests.yaml" - "server/**" - "proto/**" - "router/**" @@ -11,6 +12,12 @@ on: jobs: run_tests: runs-on: ubuntu-20.04 + + env: + SCCACHE_GHA_ENABLED: "on" + RUSTC_WRAPPER: /usr/local/bin/sccache + SCCACHE: 0.3.3 + steps: - uses: actions/checkout@v2 - name: Set up Python @@ -25,12 +32,17 @@ jobs: components: rustfmt, clippy - name: Install Protoc uses: arduino/setup-protoc@v1 - - name: Loading cache. - uses: actions/cache@v2 - id: model_cache + - name: Install sccache + run: | + curl -fsSL https://github.com/mozilla/sccache/releases/download/v$SCCACHE/sccache-v$SCCACHE-x86_64-unknown-linux-musl.tar.gz + tar -xzv --strip-components=1 -C /usr/local/bin sccache-v$SCCACHE-x86_64-unknown-linux-musl/sccache + chmod +x /usr/local/bin/sccache + - name: Configure sccache + uses: actions/github-script@v6 with: - path: ~/.cache/huggingface/ - key: models + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install run: | make install @@ -41,3 +53,6 @@ jobs: - name: Run Rust tests run: | cargo test + - name: sccache stats + run: | + /usr/local/bin/sccache --show-stats