url-eater/.github/workflows/build_nix.yml

30 lines
859 B
YAML

on: push
name: "Build Nix package on Ubuntu"
env:
RUSTFLAGS: "-Dwarnings"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- name: Building package
run: nix build
- name: Get repository name
run: echo "REPO_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Get commit hash
run: echo "COMMIT_HASH=${GITHUB_SHA::6}" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
with:
name: ${{ env.REPO_NAME }}-${{ env.COMMIT_HASH }}-x86_64-linux
path: result/bin/${{ env.REPO_NAME }}
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- name: Lint
run: nix develop --command cargo clippy --all-targets --all-features