-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (38 loc) · 1.23 KB
/
pr_cockpit-web.yml
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: web
on:
pull_request:
paths:
- ".github/workflows/pr_cockpit-web.yml"
- "package.json"
- "yarn.lock"
- "web/**"
jobs:
build-web:
name: Web frontend built
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 18
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn --cwd web run build
prettier:
name: Validate web formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 18
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn --cwd web run format --check
- name: Git Diff showed uncommitted changes
if: ${{ failure() }}
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
core.setFailed('web/ contains unformatted code, run `pnpm prettier . --write` and re-commit!')