2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

Try zigbuild

This commit is contained in:
asonix 2024-02-07 14:02:51 -06:00
parent 5414fca339
commit 839b3e0088
4 changed files with 14 additions and 59 deletions

View file

@ -1,7 +0,0 @@
FROM docker.io/asonix/rust-builder:latest-linux-amd64
RUN rustup component add clippy
COPY .forgejo/actions/build-amd64/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View file

@ -1,25 +0,0 @@
name: Build x86_64 Rust Binary
desctiption: Compiles a rust binary with a bespoke rust image
inputs:
name:
description: Name of the binary being compiled
required: true
action:
description: Action to take
required: true
default: build
build_mode:
description: debug or release
required: true
default: debug
outputs:
path:
description: Path to the produced binary
runs:
using: docker
image: Dockerfile
steps:
args:
- ${{ inputs.name }}
- ${{ inputs.action }}
- ${{ inputs.build_mode }}

View file

@ -1,21 +0,0 @@
#!/usr/bin/env bash
set -e
name=$1
action=$2
build_mode=$3
cargo "${action}" "--${build_mode}" "--target=${TARGET}"
case "$action" in
build)
echo "path=target/${TARGET}/release/${name}" >> "${GITHUB_OUTPUT}"
;;
check)
;;
test)
;;
clippy)
;;
esac

View file

@ -5,17 +5,25 @@ on:
- main - main
jobs: jobs:
test-action: zigbuild:
runs-on: docker runs-on: docker
container: container:
image: docker.io/node:20-bookworm image: docker.io/node:20-bookworm
steps: steps:
- run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
rustup target add x86_64-unknown-linux-musl
rustup target add armv7-unknown-linux-musleabihf
rustup target add aarch64-unknown-linux-musl
rustup component add clippy
cargo binstall cargo-zigbuild
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: ./.forgejo/actions/build-amd64 - run: |
with: cargo clippy --no-default-features -- -D warnings
name: pict-rs cargo zigbuild --target x86_64-unknown-linux-musl
action: clippy cargo zigbuild --target armv7-unknown-linux-musleabihf
build_mode: debug cargo zigbuild --target aarch64-unknown-linux-musl
clippy: clippy:
runs-on: docker runs-on: docker