|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + typescript: |
| 11 | + name: TypeScript (Node ${{ matrix.node-version }}) |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + node-version: [20, 22] |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Setup pnpm |
| 22 | + uses: pnpm/action-setup@v4 |
| 23 | + with: |
| 24 | + version: 9 |
| 25 | + |
| 26 | + - name: Setup Node.js ${{ matrix.node-version }} |
| 27 | + uses: actions/setup-node@v4 |
| 28 | + with: |
| 29 | + node-version: ${{ matrix.node-version }} |
| 30 | + cache: pnpm |
| 31 | + |
| 32 | + - name: Install dependencies |
| 33 | + run: pnpm install |
| 34 | + |
| 35 | + - name: Typecheck |
| 36 | + run: pnpm typecheck |
| 37 | + |
| 38 | + - name: Format check |
| 39 | + run: pnpm format:check |
| 40 | + |
| 41 | + - name: Install Playwright browsers |
| 42 | + run: pnpm exec playwright install --with-deps chromium |
| 43 | + |
| 44 | + - name: Run tests |
| 45 | + run: pnpm test |
| 46 | + |
| 47 | + rust: |
| 48 | + name: Rust (${{ matrix.os }} - ${{ matrix.target }}) |
| 49 | + runs-on: ${{ matrix.os }} |
| 50 | + strategy: |
| 51 | + matrix: |
| 52 | + include: |
| 53 | + - os: ubuntu-latest |
| 54 | + target: x86_64-unknown-linux-gnu |
| 55 | + - os: macos-latest |
| 56 | + target: aarch64-apple-darwin |
| 57 | + - os: macos-latest |
| 58 | + target: x86_64-apple-darwin |
| 59 | + - os: windows-latest |
| 60 | + target: x86_64-pc-windows-msvc |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Checkout repository |
| 64 | + uses: actions/checkout@v4 |
| 65 | + |
| 66 | + - name: Setup Rust toolchain |
| 67 | + uses: dtolnay/rust-toolchain@stable |
| 68 | + with: |
| 69 | + targets: ${{ matrix.target }} |
| 70 | + |
| 71 | + - name: Cache Cargo dependencies |
| 72 | + uses: actions/cache@v4 |
| 73 | + with: |
| 74 | + path: | |
| 75 | + ~/.cargo/bin/ |
| 76 | + ~/.cargo/registry/index/ |
| 77 | + ~/.cargo/registry/cache/ |
| 78 | + ~/.cargo/git/db/ |
| 79 | + cli/target/ |
| 80 | + key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('cli/Cargo.lock') }} |
| 81 | + restore-keys: | |
| 82 | + ${{ runner.os }}-cargo-${{ matrix.target }}- |
| 83 | +
|
| 84 | + - name: Build release binary |
| 85 | + run: cargo build --release --manifest-path cli/Cargo.toml --target ${{ matrix.target }} |
0 commit comments