Skip to content

Add: Add Lazy convertion #18

Add: Add Lazy convertion

Add: Add Lazy convertion #18

name: "[sub-image] Lint and build"
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 component add clippy
rustup target add x86_64-unknown-linux-gnu
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