Skip to content

Warm sccache for CI and release builds #12

Warm sccache for CI and release builds

Warm sccache for CI and release builds #12

# Copyright (c) Mysten Labs, Inc.
# SPDX-License-Identifier: Apache-2.0
name: Warm sccache for CI and release builds
on:
schedule:
- cron: '0 12 * * *' # every day at 4am PST (12:00 UTC)
workflow_dispatch: {}
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
# CARGO_INCREMENTAL is intentionally omitted — sccache requires it to be unset
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
jobs:
warm-cache:
name: Warm sccache (${{ matrix.os }})
timeout-minutes: 120
strategy:
matrix:
os: [ubuntu-ghcloud, ubuntu-arm64]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
SCCACHE_GCS_BUCKET: walrus-sccache
SCCACHE_GCS_KEY_PREFIX: ${{ matrix.os }}
SCCACHE_GCS_RW_MODE: READ_WRITE
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # [email protected]
with:
ref: main
- name: Configure GCP credentials
id: auth
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # [email protected]
with:
credentials_json: ${{ secrets.GCP_WALRUS_RELEASE_BUCKET_SVCUSER_CREDENTIALS }}
- name: Install postgres (Ubuntu arm64)
if: ${{ matrix.os == 'ubuntu-arm64' }}
shell: bash
run: |
sudo apt update && sudo apt install -y libpq-dev
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # [email protected]
- name: Build workspace (debug)
shell: bash
run: cargo build --workspace --features "walrus-service/backup"
- name: Build release binaries
shell: bash
run: cargo build --release
- name: Build with all features and tests (for clippy cache)
shell: bash
run: cargo build --workspace --all-features --tests
- name: Build test-opt profile (for CI test cache)
shell: bash
run: cargo build --workspace --profile test-opt
report-failure:
name: Report Failure
runs-on: ubuntu-latest
if: failure()
needs: [warm-cache]
steps:
- uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # [email protected]
- name: Dispatch to sui-operations for notification
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # [email protected]
with:
token: ${{ secrets.DOCKER_BINARY_BUILDS_DISPATCH }}
repository: MystenLabs/sui-operations
event-type: walrus-sccache-warmup-failure
client-payload: |-
{
"run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"run_id": "${{ github.run_id }}",
"workflow_name": "${{ github.workflow }}",
"workflow_conclusion": "${{ env.WORKFLOW_CONCLUSION }}"
}