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

32 lines
924 B
YAML
Raw Normal View History

2024-01-08 20:35:03 +00:00
on: push
name: "Build Nix package on Ubuntu"
2023-04-02 17:20:29 +00:00
2024-01-08 20:35:03 +00:00
env:
RUSTFLAGS: "-Dwarnings"
2023-04-02 17:20:29 +00:00
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-01-08 20:35:03 +00:00
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
2023-04-02 17:20:29 +00:00
- name: Building package
2024-01-08 20:35:03 +00:00
run: nix build
- name: Get repository name
run: echo "REPO_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
2023-04-15 12:11:53 +00:00
- name: Get commit hash
run: echo "COMMIT_HASH=${GITHUB_SHA::6}" >> $GITHUB_ENV
2023-04-05 15:22:32 +00:00
- uses: actions/upload-artifact@v3
with:
2024-01-08 20:35:03 +00:00
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
- name: Test
run: nix develop --command cargo test