LDAP #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v26 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v14 | |
with: | |
name: f0rthsp4ce | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Cache Rust | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-rust- | |
- name: Check | |
run: | | |
nix develop --command just check | |
nix develop --command cargo fmt --check | |
- name: Check hashes.nix | |
run: | | |
sha256sum hashes.nix > /tmp/original_hashes | |
nix develop --command just hashes | |
sha256sum hashes.nix > /tmp/new_hashes | |
if diff /tmp/original_hashes /tmp/new_hashes >/dev/null; then | |
echo "OK! Files are the same." | |
else | |
echo "Error! Files differ." | |
echo "New content:" | |
cat hashes.nix | |
exit 1 | |
fi | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v26 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v14 | |
with: | |
name: f0rthsp4ce | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Build | |
run: nix build |