Skip to content

Commit

Permalink
ci: add rust and nix jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnossiom committed May 9, 2024
1 parent 8ab2d80 commit 7059a9c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Nix
on: [push, pull_request]

jobs:
build:
name: Check flake and upload build cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Cachix
uses: cachix/cachix-action@v13
with:
name: mrnossiom
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Check flake structure
run: nix flake check

- name: Build nix package
run: nix build --print-build-logs
20 changes: 20 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Rust
on: [push, pull_request]

jobs:
check:
name: Check and test Rust code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- run: cargo check
- run: cargo test
- run: cargo fmt --all -- --check
- run: cargo clippy -- -D warnings

0 comments on commit 7059a9c

Please sign in to comment.