enha: change lock order (#1503) #200
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 Binary | |
on: | |
workflow_dispatch: | |
inputs: | |
features: | |
description: 'List of features to enable' | |
required: false | |
default: '' | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'src/**' | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
- 'tests/fixtures/**' | |
- 'static/**' | |
- '.sqlx/**' | |
env: | |
RETENTION_DAYS: 90 | |
jobs: | |
build_binaries: | |
name: Build and upload | |
runs-on: ubuntu-latest | |
timeout-minutes: 45 | |
concurrency: | |
group: ${{ github.workflow }}-{{ github.run_id }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Rust | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.79 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
id: cache-cargo | |
with: | |
prefix-key: ${{ runner.os }}-v3-cargo | |
shared-key: artifact | |
cache-provider: "github" | |
save-if: ${{ github.ref_name == 'main' && github.event_name == 'push' }} | |
- name: Install protoc | |
run: sudo apt-get install -y protobuf-compiler | |
- name: Build binaries | |
run: | | |
cargo build --release \ | |
--bin run-with-importer --bin stratus --bin importer-online --bin relayer \ | |
--features "$FEATURES" | |
env: | |
CARGO_PROFILE_RELEASE_DEBUG: 1 | |
TRACING_LOG_FORMAT: json | |
NO_COLOR: 1 | |
FEATURES: "${{ github.event.inputs.features || 'default' }}" | |
- name: Upload run with importer | |
uses: actions/upload-artifact@v4 | |
id: upload-rwi | |
with: | |
name: run-with-importer-${{ github.sha }} | |
path: target/release/run-with-importer | |
if-no-files-found: error | |
retention-days: ${{ env.RETENTION_DAYS }} | |
- name: Upload stratus | |
uses: actions/upload-artifact@v4 | |
id: upload-str | |
with: | |
name: stratus-${{ github.sha }} | |
path: target/release/stratus | |
if-no-files-found: error | |
retention-days: ${{ env.RETENTION_DAYS }} | |
- name: Upload importer online | |
uses: actions/upload-artifact@v4 | |
id: upload-iom | |
with: | |
name: importer-online-${{ github.sha }} | |
path: target/release/importer-online | |
if-no-files-found: error | |
retention-days: ${{ env.RETENTION_DAYS }} | |
- name: Upload relayer | |
uses: actions/upload-artifact@v4 | |
id: upload-rel | |
with: | |
name: relayer-${{ github.sha }} | |
path: target/release/relayer | |
if-no-files-found: error | |
retention-days: ${{ env.RETENTION_DAYS }} | |
- name: Print outputs | |
run: | | |
echo "Artifact ID: ${{ steps.upload-rwi.outputs.artifact-id }} (run with importer)" | |
echo "Artifact URL: ${{ steps.upload-rwi.outputs.artifact-url }} (run with importer)" | |
echo "Artifact ID: ${{ steps.upload-str.outputs.artifact-id }} (stratus)" | |
echo "Artifact URL: ${{ steps.upload-str.outputs.artifact-url }} (stratus)" | |
echo "Artifact ID: ${{ steps.upload-iom.outputs.artifact-id }} (importer online)" | |
echo "Artifact URL: ${{ steps.upload-iom.outputs.artifact-url }} (importer online)" | |
echo "Artifact ID: ${{ steps.upload-rel.outputs.artifact-id }} (relayer)" | |
echo "Artifact URL: ${{ steps.upload-rel.outputs.artifact-url }} (relayer)" |