Skip to content

Yay support

Yay support #62

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
container:
image: archlinux:base
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pacman -Sy --noconfirm base-devel rustup
rustup default stable
rustup component add rustfmt clippy
- name: Check formatting
id: fmt
run: cargo fmt --check
continue-on-error: true
- name: Clippy
id: clippy
run: cargo clippy -- -D warnings
continue-on-error: true
- name: Build
run: cargo build --release
- name: Run tests
run: |
BIN="./target/release/pacfetch"
echo "=== Flag tests ==="
$BIN -h
$BIN --help
$BIN -V
$BIN -v
$BIN --local
echo "=== Invalid flag tests ==="
! $BIN -S
! $BIN -y
! $BIN -u
! $BIN -yu
! $BIN --badarg
echo "=== Output tests ==="
$BIN --local 2>&1 | grep -q "Disk (/)"
echo "=== Root operation tests ==="
$BIN -Sy
echo "n" | $BIN -Su
echo "n" | $BIN -Syu
echo "All tests passed"
- name: Check for failures
if: steps.fmt.outcome == 'failure' || steps.clippy.outcome == 'failure'
run: |
echo "::error::Formatting or clippy checks failed"
exit 1