temporary addition of eval_modal.rs, needs update with nn #292
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches-ignore: | |
- main | |
jobs: | |
build_docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Work around permissions issue | |
run: git config --global --add safe.directory /__w/hidive/hidive | |
- uses: 'actions/checkout@v3' | |
- name: Cache Rust dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Build Rust binary | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
run: | | |
cargo build --release | |
strip target/release/hidive | |
sccache --show-stats | |
- name: Authenticate to Google Cloud | |
id: 'auth' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.repository }}-${{ hashFiles('docker/**') }} | |
restore-keys: | | |
${{ runner.os }}-buildx-${{ github.repository }}- | |
${{ runner.os }}-buildx- | |
- name: Configure Docker to use gcloud credentials | |
run: gcloud auth configure-docker us.gcr.io -q | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./docker | |
push: true | |
tags: us.gcr.io/broad-dsp-lrma/lr-hidive:${{ github.ref_name }} | |
build-args: | | |
branch=v${{ github.ref_name }} | |
cache-from: | | |
type=local,src=/tmp/.buildx-cache | |
type=gha,scope=${{ github.repository }} | |
cache-to: | | |
type=local,dest=/tmp/.buildx-cache-new,mode=max | |
type=gha,mode=max,scope=${{ github.repository }} | |
build-contexts: | | |
binary=./target/release | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |