Skip to content

chore: make the actions workflow generic over rust target #13

chore: make the actions workflow generic over rust target

chore: make the actions workflow generic over rust target #13

Workflow file for this run

name: Rust
on:
[push, pull_request]
env:
CARGO_TERM_COLOR: always
rust_target: x86_64-unknown-linux-musl
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install musl dependencies
if: ${{ env.rust_target == 'x86_64-unknown-linux-musl' }}
run: sudo apt-get update && sudo apt-get install musl-tools
- name: Install rust toolchain
id: init
run: |
rustup toolchain install stable --profile minimal
rustup target add "$rust_target"
echo "##[set-output name=sha7;]$(echo ${GITHUB_SHA:0:7})"
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose --release --target "$rust_target"
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: server-wrapper-${{ steps.init.outputs.sha7 }}-${{ env.rust_target }}
path: target/${{ env.rust_target }}/release/server-wrapper