Skip to content

Bump paste from 1.0.7 to 1.0.14 #28

Bump paste from 1.0.7 to 1.0.14

Bump paste from 1.0.7 to 1.0.14 #28

Workflow file for this run

name: Continuous Integration
on:
push:
branches: [main]
pull_request:
branches: [main]
# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
xtask:
runs-on: ubuntu-20.04
timeout-minutes: 120
# We use the same job template, but parametrize the actual command to be passed to the xtask
# binary using the matrix strategy, so that we get the commands running in parallel.
strategy:
fail-fast: false
matrix:
cmd:
# Do not add `run-ci` to these commands. We parse them for `xtask run-ci`.
- check-format
- run-cargo-deny
- run-cargo-udeps
- build-oak-functions-server-variants
- run-cargo-tests
# TODO(#2538): Re-enable when bazel tests run on the main Docker image.
# - run-bazel-tests
- run-oak-functions-examples --application-variant=rust
- run-cargo-fuzz --build-deps -- -max_total_time=2
- completion
- run-cargo-clippy
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Print disk space
run: |
df --human-readable
- name: Docker pull
timeout-minutes: 10
run: |
./scripts/docker_pull
df --human-readable
# Store various common Rust folders to speed up future runs.
#
# The main cache key includes the combined hash of all Cargo.lock files in the repository, but
# falls back on a more generic prefix if an exact match is not found, so that there is at
# least some chance that some of the artifacts will be found there.
#
# We specify the `./cargo-cache` folder (as per `/scripts/docker_run`), as well as various
# `target` folders. This can probably be improved in a variety of ways over time.
#
# See https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
- name: Cache Rust artifacts
uses: actions/cache@v2
env:
# Increment this value to invalidate previous cache entries.
CACHE_VERSION: 3
with:
path: |
./cargo-cache/bin
./cargo-cache/registry/index
./cargo-cache/registry/cache
./cargo-cache/git/db
./sccache-cache
./target
key: |
cargo-cache-${{ env.CACHE_VERSION }}-${{ matrix.cmd }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-cache-${{ env.CACHE_VERSION }}-${{ matrix.cmd }}-
cargo-cache-${{ env.CACHE_VERSION }}-
- name: Run command
run: |
./scripts/docker_run ./scripts/xtask --commands --scope=all ${{ matrix.cmd }}
df --human-readable
- name: Generate root CA certs
run: ./scripts/docker_run ./scripts/generate_root_ca_certs
# Ensure that the previous steps did not modify our source-code and that
# relevant build artifacts are ignored by git.
- name: Git check diff
run: ./scripts/docker_run ./scripts/git_check_diff
android-runner:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Checkout branch
uses: actions/checkout@v2
# Copied from https://github.com/jens-maus/RaspberryMatic/blob/ea6b8ce0dd2d53ea88b2766ba8d7f8e1d667281f/.github/workflows/ci.yml#L34-L40
# and https://github.com/actions/virtual-environments/issues/709#issuecomment-612569242
- name: Free disk space
run: |
df --human-readable
sudo apt clean
docker rmi $(docker image ls --all --quiet)
rm --recursive --force "$AGENT_TOOLSDIRECTORY"
df --human-readable
# Build Docker image based for Android SDK.
- name: Android Docker build
timeout-minutes: 30
run: |
docker pull gcr.io/oak-ci/oak-android:latest
docker build --pull --cache-from=gcr.io/oak-ci/oak-android:latest --tag=gcr.io/oak-ci/oak-android:latest --file=android.Dockerfile --build-arg=USER_UID="$DOCKER_UID" --build-arg=USER_GID="$DOCKER_GID" .
# Build Android-based examples.
- name: Build Android Hello-World
run:
docker run --volume=$PWD:/workspace --workdir=/workspace
gcr.io/oak-ci/oak-android:latest ./scripts/build_examples_android
cargo-crev-verify:
runs-on: ubuntu-20.04
steps:
- name: Checkout branch
uses: actions/checkout@v2
# Copied from https://github.com/jens-maus/RaspberryMatic/blob/ea6b8ce0dd2d53ea88b2766ba8d7f8e1d667281f/.github/workflows/ci.yml#L34-L40
# and https://github.com/actions/virtual-environments/issues/709#issuecomment-612569242
- name: Free disk space
run: |
df --human-readable
sudo apt clean
docker rmi $(docker image ls --all --quiet)
rm --recursive --force "$AGENT_TOOLSDIRECTORY"
df --human-readable
- name: Docker pull
timeout-minutes: 10
run: |
./scripts/docker_pull
df --human-readable
- name: Cargo crev verification
run: |
./scripts/docker_run ./scripts/run_cargo_crev
df --human-readable