Skip to content

Fix: Fix rustup command #15

Fix: Fix rustup command

Fix: Fix rustup command #15

name: "[sub-image] Lint with black"
on:
push:
paths:
- "sub-image/**"
- ".github/workflows/sub-image-*.yml"
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./sub-image
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup rust
run: |
rustup toolchain install clippy
rustup target add aarch64-unknown-linux-gnu
- name: Cache target
uses: Swatinem/rust-cache@v2
- name: Run check
run: |
cargo clippy
cargo fmt -- --check
cargo test
- name: Build binary
if: github.ref_name == 'main'
working-directory: .
run: |
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu
mkdir /tmp/sub-image/arm64 -p
mkdir /tmp/sub-image/amd64 -p
cp target/x86_64-unknown-linux-gnu/release/sub-image /tmp/sub-image/amd64/sub-image
cp target/aarch64-unknown-linux-gnu/release/sub-image /tmp/sub-image/arm64/sub-image
- name: Build image
if: github.ref_name == 'main'
uses: ./.github/actions/build
with:
directory-name: sub-image