|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, upgrade-deps-singlestage ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Lint, Test, Build |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + env: |
| 15 | + CARGO_TERM_COLOR: always |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Set up Rust (stable) |
| 22 | + uses: dtolnay/rust-toolchain@stable |
| 23 | + with: |
| 24 | + components: clippy, rustfmt |
| 25 | + |
| 26 | + - name: Cache cargo registry + build |
| 27 | + uses: actions/cache@v4 |
| 28 | + with: |
| 29 | + path: | |
| 30 | + ~/.cargo/registry |
| 31 | + ~/.cargo/git |
| 32 | + target |
| 33 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 34 | + restore-keys: | |
| 35 | + ${{ runner.os }}-cargo- |
| 36 | +
|
| 37 | + - name: Cargo fmt (check) |
| 38 | + run: cargo fmt --all -- --check |
| 39 | + |
| 40 | + - name: Cargo clippy |
| 41 | + run: cargo clippy --workspace --all-targets -- -D warnings |
| 42 | + |
| 43 | + - name: Cargo test |
| 44 | + run: cargo test --workspace --all-features --no-fail-fast |
| 45 | + |
| 46 | + - name: Set up Bun |
| 47 | + uses: oven-sh/setup-bun@v2 |
| 48 | + with: |
| 49 | + bun-version: latest |
| 50 | + |
| 51 | + - name: Cache node_modules (bun) |
| 52 | + uses: actions/cache@v4 |
| 53 | + with: |
| 54 | + path: | |
| 55 | + node_modules |
| 56 | + ~/.cache/bun |
| 57 | + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} |
| 58 | + restore-keys: | |
| 59 | + ${{ runner.os }}-bun- |
| 60 | +
|
| 61 | + - name: Install JS dependencies |
| 62 | + run: bun install --frozen-lockfile |
| 63 | + |
| 64 | + - name: Build CSS (Tailwind) |
| 65 | + run: bun run build |
| 66 | + |
| 67 | + - name: Cargo build (release) |
| 68 | + run: cargo build --release |
| 69 | + |
| 70 | + - name: Generate site (SSG) |
| 71 | + run: ./target/release/typstify-ssg |
| 72 | + |
| 73 | + - name: Upload site artifact |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: site |
| 77 | + path: | |
| 78 | + site/** |
| 79 | + style/output.css |
0 commit comments