From 965cfe268caf141373f8470d1c6a91395b262822 Mon Sep 17 00:00:00 2001 From: Leon Riesebos <28567817+lriesebos@users.noreply.github.com> Date: Sat, 11 Apr 2026 23:21:03 -0400 Subject: [PATCH] feat(github): added workflows for ci and crates.io publish closes #26 --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ .github/workflows/publish.yml | 24 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml 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