Merge pull request #1539 from EspressoSystems/ed/reduce-logging-2 #3319
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: Build and Test Workflow | |
on: | |
push: | |
branches: | |
- 'benchmarking_*' | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
- '*/*' | |
schedule: | |
- cron: '0 0 * * 1' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: styfle/[email protected] | |
name: Cancel Outdated Builds | |
with: | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
name: Checkout Repository | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y protobuf-compiler | |
- uses: Swatinem/rust-cache@v2 | |
name: Enable Rust Caching | |
- name: Audit | |
# TODO remove ignore flag if/when ansiterm cve fixed | |
run: cargo audit --ignore RUSTSEC-2021-0139 | |
- name: Check | |
run: cargo check --features=full-ci --workspace | |
- name: Build all crates in workspace | |
run: cargo build --verbose --profile=release-lto --features=full-ci --lib --bins --tests --benches --workspace --examples | |
- name: Unit and integration tests for all crates in workspace | |
run: | | |
cargo test --verbose --profile=release-lto --features=full-ci --lib --bins --tests --benches --workspace --no-fail-fast -- --test-threads=1 | |
timeout-minutes: 60 | |
env: | |
RUST_BACKTRACE: full | |
- name: Setup Docker BuildKit (buildx) | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Github Container Repo | |
uses: docker/login-action@v2 | |
if: github.event_name != 'pull_request' | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate docker metadata (web-server) | |
uses: docker/metadata-action@v4 | |
id: web-server | |
with: | |
images: ghcr.io/espressosystems/hotshot/web-server | |
- name: Build and push web-server docker | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./ | |
file: ./deploy/web-server.Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.web-server.outputs.tags }} | |
labels: ${{ steps.web-server.outputs.labels }} | |