aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: c4d2a297f47bc35ff55ab691cd25ad0d8e58ba2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: CI

on:
  pull_request:
    types: [opened, synchronize, reopened]
  push:
    branches: [master]
    paths-ignore:
      - "website/**"
      - ".github/APPROVED_CONTRIBUTORS"

permissions:
  contents: read

concurrency:
  group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  conventional-commits:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          fetch-depth: 0
          persist-credentials: false

      - name: Validate commit subjects
        if: github.event_name == 'push'
        run: python3 scripts/conventional_commits.py --range "${{ github.event.before }}..${{ github.event.after }}"

      - name: Validate PR title
        if: github.event_name == 'pull_request'
        run: python3 scripts/conventional_commits.py "${{ github.event.pull_request.title }}"

  check:
    name: check (${{ matrix.os }})
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          persist-credentials: false

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Install Rust tools
        uses: taiki-e/install-action@b550161ef8a7bc4f2a671c0b03a18ac9ccedea1e # v2
        with:
          tool: just,cargo-nextest

      - name: Install Zig
        uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
        with:
          version: 0.15.2

      - name: Install macOS build tools
        if: runner.os == 'macOS'
        run: brew install cmake ninja

      - name: Restore cargo cache
        uses: Swatinem/rust-cache@v2
        with:
          cache-bin: false

      - name: Run checks
        run: just ci