Skip to content

feat(#300): rskim-tokens — multi-provider tokenization library API #789

feat(#300): rskim-tokens — multi-provider tokenization library API

feat(#300): rskim-tokens — multi-provider tokenization library API #789

Workflow file for this run

name: CI
on:
push:
branches: [ main, feature/* ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v5
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v5
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Run cargo tests
run: cargo test --all-features
- name: Run cargo doc tests
run: cargo test --doc
security-tests:
name: Security Test Suites
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '22'
- name: Run npm package structure tests
run: node scripts/ci/test-npm-packages.mjs
- name: Run version check validation tests
run: bash scripts/ci/test-version-check.sh
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v5
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v5
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
# --all-targets required per PF-009: catches warnings in #[cfg(test)] modules
# that are missed by cargo clippy without --all-targets.
run: cargo clippy --all-features --all-targets -- -D warnings
- name: Dependency-tree isolation check (AC9)
# Proves no HTTP/TLS crate appears in the default-features build of
# rskim-tokens or the skim binary. Uses set -o pipefail per PF-007.
run: |
set -o pipefail
echo "=== rskim-tokens default-features tree ==="
cargo tree -p rskim-tokens -e normal 2>&1 | tee /tmp/rskim-tokens-tree.txt
if grep -qE 'ureq|reqwest|hyper|rustls|native-tls|openssl' /tmp/rskim-tokens-tree.txt; then
echo "FAIL: HTTP/TLS dependency found in rskim-tokens default build"
exit 1
fi
echo "PASS: no HTTP/TLS in rskim-tokens default build"
echo "=== skim binary default-features tree ==="
cargo tree -p rskim -e normal 2>&1 | tee /tmp/rskim-tree.txt
if grep -qE 'ureq|reqwest|hyper|rustls|native-tls|openssl' /tmp/rskim-tree.txt; then
echo "FAIL: HTTP/TLS dependency found in skim binary default build"
exit 1
fi
echo "PASS: no HTTP/TLS in skim binary default build"
build:
name: Build Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v5
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v5
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Build release binary
run: cargo build --release -p rskim
- name: Smoke test
run: |
./target/release/skim --version
echo "fn main() {}" | ./target/release/skim - --language=rust