Skip to content

rm flag

rm flag #179

Workflow file for this run

name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# Web viewer tests (TypeScript)
web-tests:
name: Web Viewer Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: web/package-lock.json
- name: Install dependencies
working-directory: web
run: npm ci
- name: Type check
working-directory: web
run: npm run type-check
- name: Run tests
working-directory: web
run: npm run test:run
# Rust build and tests
build:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: x86_64-apple-darwin
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.target }}-
${{ runner.os }}-cargo-
- name: Check code formatting
run: cargo fmt --all -- --check
continue-on-error: true
- name: Run clippy
run: cargo clippy --workspace --target ${{ matrix.target }} --all-targets
- name: Build workspace (debug)
run: cargo build --workspace --target ${{ matrix.target }}
- name: Run tests
run: cargo test --workspace --target ${{ matrix.target }}
- name: Build key binaries (release)
shell: bash
run: |
cargo build --release --target ${{ matrix.target }} \
-p metrics-cli \
--bin detect_unused_specs \
--bin generate_index_scip_json \
--bin generate_function_subgraph_dot \
--bin generate_call_graph_dot \
--bin write_atoms \
--bin run_full_pipeline
- name: Test binary functionality (Unix)
if: runner.os != 'Windows'
run: |
# Test that binaries show usage when run without arguments
echo "Testing detect_unused_specs..."
./target/${{ matrix.target }}/release/detect_unused_specs || echo "Expected exit for usage message"
echo "Testing generate_index_scip_json..."
./target/${{ matrix.target }}/release/generate_index_scip_json || echo "Expected exit for usage message"
echo "Testing write_atoms..."
./target/${{ matrix.target }}/release/write_atoms || echo "Expected exit for usage message"
echo "Testing run_full_pipeline..."
./target/${{ matrix.target }}/release/run_full_pipeline --help || echo "Expected exit for usage message"
echo "All binaries tested successfully!"
- name: Test binary functionality (Windows)
if: runner.os == 'Windows'
run: |
# Test that binaries show usage when run without arguments
Write-Host "Testing detect_unused_specs..."
& "target\${{ matrix.target }}\release\detect_unused_specs.exe"
Write-Host "Testing generate_index_scip_json..."
& "target\${{ matrix.target }}\release\generate_index_scip_json.exe"
Write-Host "Testing write_atoms..."
& "target\${{ matrix.target }}\release\write_atoms.exe"
Write-Host "Testing run_full_pipeline..."
& "target\${{ matrix.target }}\release\run_full_pipeline.exe" --help
Write-Host "All binaries tested successfully!"