summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/webclient.yml
blob: d48806c4096acfca5ba14ca70df7b835ca30509b (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
name: webclient
on:
  workflow_dispatch:
  # For now, only run on requests, not the main branches.
  pull_request:
    branches:
      - "*"
    paths:
      - "client/web/**"
      - ".github/workflows/webclient.yml"
      - "!**.md"
  # TODO(soniaappasamy): enable for main branch after an initial waiting period.
  #push:
  #  branches:
  #    - main

concurrency:
  group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  webclient:
    runs-on: ubuntu-latest

    steps:
      - name: Check out code
        uses: actions/checkout@v4
      - name: Install deps
        run: ./tool/yarn --cwd client/web
      - name: Run lint
        run: ./tool/yarn --cwd client/web run --silent lint
      - name: Run test
        run: ./tool/yarn --cwd client/web run --silent test
      - name: Run formatter check
        run: |
          ./tool/yarn --cwd client/web run --silent format-check || ( \
            echo "Run this command on your local device to fix the error:" && \
            echo "" && \
            echo "  ./tool/yarn --cwd client/web format" && \
            echo "" && exit 1)