brewlog/.github/workflows/push.yml
2026-05-22 13:18:31 +00:00

79 lines
2.2 KiB
YAML

name: CI
on:
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v4
- name: Cache Cargo artifacts
uses: actions/cache@v5
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-check
restore-keys: |
cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-
cargo-${{ runner.os }}-
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y clang lld mold libssl-dev pkg-config
- name: Ensure Rust components
run: rustup component add rustfmt clippy
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test -- --show-output
e2e:
name: E2E Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v4
- name: Cache Cargo artifacts
uses: actions/cache@v5
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-e2e
restore-keys: |
cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-
cargo-${{ runner.os }}-
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y clang lld mold libssl-dev pkg-config libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2t64 libnss3 libxshmfence1
- name: Install Chrome for Testing
run: mise run install-e2e
- name: Run E2E tests
run: cargo test --features e2e --test e2e -- --show-output