Yay support #62
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |