Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
iname: ci

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
quality-gate:
name: lint & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install nix
uses: DeterminateSystems/nix-installer-action@main

- name: nix magic cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: check flake syntax
run: nix flake check

- name: rust lint
run: |
nix develop -c cargo fmt --all -- --check
nix develop -c cargo clippy -- -D warnings

- name: run tests
run: nix develop -c cargo test --verbose

build-linux:
name: build linux release
needs: quality-gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install nix
uses: DeterminateSystems/nix-installer-action@main

- name: nix magic cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: build linux release bin
run: nix develop -c cargo build --release

deploy:
name: Ddploy application
needs: build-linux

# only deploy on pushes to main
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install nix
uses: DeterminateSystems/nix-installer-action@main

- name: nix magic cache
uses: DeterminateSystems/magic-nix-cache-action@main

# - name: deploy step
# run: |
# echo "your build passed! Add your deployment commands here."
# # example: nix run .#deploy
# # Or copy the binary built via cargo to your server/crates.io

Loading