-
Notifications
You must be signed in to change notification settings - Fork 357
44 lines (38 loc) · 1.44 KB
/
main.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
41
42
43
44
name: Check format
run-name: Checking format
on:
pull_request:
branches:
- master
jobs:
install:
name: "Install"
runs-on: ubuntu-latest
steps:
- name: Checkout files
uses: actions/checkout@v3
- name: Install node_modules
# This action does not work very well with subdirectories out of the box,
# but we can use this workaround to make it work.
# Note that this is highly dependent on the version of the action used
uses: OffchainLabs/actions/node-modules/install@35a1f8c3f3ad803e1fd9b81b94d063a4fc90a030
with:
install-command: cd website && yarn install --frozen-lockfile
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
check-formatting:
name: "Check Formatting"
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout files
uses: actions/checkout@v3
- name: Restore node_modules
# This action does not work very well with subdirectories out of the box,
# but we can use this workaround to make it work.
# Note that this is highly dependent on the version of the action used
uses: OffchainLabs/actions/node-modules/restore@35a1f8c3f3ad803e1fd9b81b94d063a4fc90a030
with:
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Check formatting with Prettier
working-directory: ./website
run: yarn format:check