Skip to content

Commit

Permalink
Create meticulous.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
martinheppner authored Aug 20, 2024
1 parent fd7f8f1 commit fbc8cb5
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/meticulous.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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:
- uat
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
contents: read
issues: write
pull-requests: write
statuses: read

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@v4
with:
node-version: "20"
cache: npm

- name: Cache node_modules
id: cache-npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Serve project
# TODO: Update these commands to serve your app's frontend locally, and
# then update the app-url to match.
# We strongly recommend you serve the app with a non-development server.
# For instance, if you are using Vite, use 'vite preview' instead of 'vite'
# or 'vite serve' to spin up the app.
# The sleep is often required to ensure your app is readily being served
# by the time the Meticulous tests start
run: |
npm run start-remote-api &
sleep 5
- name: Run Meticulous tests
uses: alwaysmeticulous/report-diffs-action/cloud-compute@v1
with:
api-token: ${{ secrets.METICULOUS_API_TOKEN }}
# TODO: Update the port and protocol below to match your app's frontend
app-url: "http://localhost:3000/"

0 comments on commit fbc8cb5

Please sign in to comment.