armv7-unknown-linux-gnueabihf #24
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build_hello-world: | |
defaults: | |
run: | |
working-directory: rust/hello-world | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Install rustup parts | |
run: | | |
rustup toolchain install stable-armv7-unknown-linux-gnueabihf | |
rustup target add armv7-unknown-linux-gnueabihf | |
- name: Install gcc-multilib | |
run: sudo apt-get install -y gcc-multilib | |
- name: Lint | |
run: | | |
cargo fmt -- --check | |
cargo clippy -- -D warnings | |
- name: Test | |
run: | | |
cargo check | |
cargo test --all | |
- name: Build release | |
run: cargo build --release --target armv7-unknown-linux-gnueabihf | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hello-world | |
path: | | |
rust/hello-world/target/release/hello-world | |
- name: Log into ghcr.io | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/babdor/curly-meme | |
- name: Get binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: hello-world | |
path: ./ | |
- name: Build and push to ghcr | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
push: true | |
tags: ${{ env.REGISTRY }}/babdor/curly-meme:latest | |
labels: ${{ steps.meta.outputs.labels }} |