-
-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (72 loc) · 2.59 KB
/
meticulous.yaml
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
75
76
77
78
79
80
81
82
83
# Workflow for serving app locally & running Meticulous tests against it
name: Meticulous
# Important: The workflow needs to run both on pushes to your main branch and on
# pull requests. It needs to run on your main branch because it'll use the results
# from the base commit of the PR on the main branch to compare against.
on:
push:
branches:
- main
pull_request: {}
# Important: We need the workflow to be triggered on workflow_dispatch events,
# so that Meticulous can run the workflow on the base commit to compare
# against if an existing workflow hasn't run
workflow_dispatch: {}
# Important: The workflow needs all the permissions below.
# These permissions are mainly need to post and update the status check and
# feedback comment on your PR. Meticulous won’t work without them.
permissions:
actions: write
checks: write
contents: read
discussions: write
pull-requests: write
statuses: write
jobs:
test:
name: Report diffs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: "20"
cache: yarn
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node-modules-${{ runner.os }}
- name: Install dependencies
run: |
yarn install --frozen-lockfile --non-interactive
- name: Build project
run: |
yarn build
- name: Serve project
env:
PORT: 3000
# TODO: Update these commands to serve your app's frontend locally, and
# then update the app-url to match.
#
# Notes:
#
# 1. Please make sure your serve command listens 0.0.0.0 rather than
# localhost or 127.0.0.1 (i.e. listens to all requests via all network
# interfaces rather than just the loopback interface - see
# https://stackoverflow.com/a/20778887 for more details)
# 2. The sleep is often required to ensure your app is readily being served
# by the time the Meticulous tests start
run: |
yarn start &
sleep 10
- name: Run Meticulous tests
uses: alwaysmeticulous/report-diffs-action@v1
with:
api-token: RJk3ENlIA0S2CvsL9gMQPEUp30cD9EJtMerNOYZN
# TODO: Update the port and protocol below to match your app's frontend
app-url: "http://localhost:3000/"