Some optimizations on our Docker github workflow (#2688) #768
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: Docker | |
on: | |
push: | |
branches: [ main, 'devnet_*', 'testnet_*' ] | |
pull_request: | |
branches: | |
- "**" | |
paths: | |
- 'docker/Dockerfile' | |
- 'docker/docker-compose.yml' | |
- 'docker/compose.sh' | |
- 'Cargo.toml' | |
- '.github/workflows/docker.yml' | |
workflow_dispatch: | |
# This allows a subsequently queued workflow run to interrupt previous runs on pull-requests | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }}' | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
RUST_BACKTRACE: short | |
# We allow redundant explicit links because `cargo rdme` doesn't know how to resolve implicit intra-crate links. | |
RUSTDOCFLAGS: -A rustdoc::redundant_explicit_links -D warnings | |
RUSTFLAGS: -D warnings | |
RUSTUP_MAX_RETRIES: 10 | |
RUST_LOG: warn | |
DOCKER_COMPOSE_WAIT: "true" | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest-16-cores | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build client binary | |
run: | | |
cargo install --path linera-service --bin linera --bin linera-server --debug | |
- name: Run Compose | |
run: | | |
cd docker | |
./compose.sh | |
- name: Sync | |
uses: nick-fields/retry@v2 | |
with: | |
# Docker compose can take some time to start | |
max_attempts: 10 | |
timeout_minutes: 2 | |
retry_wait_seconds: 10 | |
command: linera --wallet docker/wallet.json --storage rocksdb:docker/linera.db sync-balance |