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

on: [push, pull_request]
on:
push:
branches: [master, main]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Cargo Test
runs-on: ubuntu-latest
name: Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: taiki-e/install-action@v2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: just,cargo-nextest

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

- name: Run CI checks
run: just ci

features:
name: Feature Combinations
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup component add --toolchain stable rustfmt rust-src
rustup default stable
uses: dtolnay/rust-toolchain@stable

- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: just,cargo-nextest

- name: Cache Dependencies
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
uses: Swatinem/rust-cache@v2

- name: Test
run: just ci
- name: Test feature combinations
run: just features

- name: Test with all features
run: just test-all-features
32 changes: 30 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
# Cross-platform CI tasks
ci:
just test
just nostd
just clippy
cargo fmt --check --all

# Run tests using cargo-nextest
test *args:
cargo nextest run {{args}}

# Check no_std compatibility
nostd:
cargo check --no-default-features -p pk2

# Run clippy lints
clippy:
cargo clippy --workspace --all-targets --all-features -- -D warnings

test *args:
cargo nextest run {{args}} < /dev/null
# Feature matrix testing
features:
@echo "Testing no default features..."
cargo check --no-default-features -p pk2
@echo "Testing std feature only..."
cargo check --no-default-features --features std -p pk2
@echo "Testing euc-kr feature only..."
cargo check --no-default-features --features euc-kr -p pk2
@echo "Testing all features..."
cargo check --all-features --workspace
@echo "All feature combinations passed!"

# Run tests with all features
test-all-features:
cargo nextest run --workspace --all-features

# Build documentation
docs:
cargo doc --workspace --no-deps --document-private-items

# Clean build artifacts
clean:
cargo clean