name: checks
on: [push, pull_request]
jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- name: Pull source
uses: actions/checkout@v2
- run: sudo apt -y install pkg-config libssl-dev liblzma-dev
- name: Run cargo test
run: cargo test
env:
RUSTFLAGS: -D warnings
fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- name: Pull source
uses: actions/checkout@v2
- name: Run cargo fmt
run: cargo fmt --all -- --check
clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- name: Pull source
uses: actions/checkout@v2
- run: sudo apt -y install pkg-config libssl-dev liblzma-dev
- name: Run cargo clippy
run: cargo clippy
env:
RUSTFLAGS: -D warnings
static-musl-build:
name: Build statically-linked musl binary
runs-on: ubuntu-latest
steps:
- name: Pull source
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Set up Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build static binary
run: nix build .#static -L
- name: Check the binary
run: nix run nixpkgs#file -- result/bin/pwninit