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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
check-and-test:
name: Check, Test & Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

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

- name: Cargo Format Check
run: cargo fmt --check

- name: Clippy Linter
run: cargo clippy -- -D warnings

- name: Run Tests
run: cargo test --verbose

- name: Build Release
run: cargo build --release --verbose
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
build-and-release:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
asset_name: satra-x86_64-linux
use_cross: false
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
asset_name: satra-aarch64-linux
use_cross: true

steps:
- uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install cross
if: matrix.use_cross
run: cargo install cross --git https://github.com/cross-rs/cross

- name: Build binary
run: |
if [ "${{ matrix.use_cross }}" = "true" ]; then
cross build --release --target ${{ matrix.target }}
else
cargo build --release --target ${{ matrix.target }}
fi

- name: Package asset
run: |
cp "target/${{ matrix.target }}/release/satra" "${{ matrix.asset_name }}"

- name: Upload binary to release
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.asset_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/target
**/*.rs.bk
*.swp
*.bak
.DS_Store
Loading
Loading