diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bfee639 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: + pull_request: + branches: [master] + +jobs: + check: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Install Nix + uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6 + with: + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + + - name: Nix fmt + run: nix fmt -- --ci + - name: Cargo fmt + run: nix develop -c -- cargo fmt --check + - name: Cargo Clippy + run: nix develop -c -- cargo clippy --all-features -- -D warnings diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a6be300 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: Publish to crates.io + +on: + push: + tags: + - "v*" + +jobs: + publish: + runs-on: ubuntu-24.04 + environment: release + + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Install Nix + uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6 + with: + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + + - name: Cargo publish + run: nix develop -c -- cargo publish