-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.55 KB
/
realworld-test.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
45
46
47
48
# this workflow runs a check on the collection of APIs at https://apis.guru/
# if more than one specification is present per API it will only check the lastest
# about 2200 specifications are checked this way
# If it finds specifications that do not match the relevant openApi JSON schema
# and for which no previous failure is known in /test/realworld/failed.json
# it will create a new report and commit this
#
name: "Real world API test"
on:
schedule:
# once week on thursday
- cron: '19 16 * * 4'
workflow_dispatch:
inputs:
nodeVersion:
description: Node version to use
required: false
default: "lts/*"
permissions:
contents: write
jobs:
realWorldTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ github.event.inputs.nodeVersion }}
- run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline
- run: npm run build --if-present
- name: Start the test
run: npm run realWorldTestCI
- name: Run format to avoid validation errors on next CI
run: npx eslint --fix
- name: Push changes to remote
run: |
git add test/realworld/failed*
git \
-c user.name="GitHub Actions" \
-c user.email="[email protected]" \
commit -m "Updated Real World test report on `date +%F`" \
--author "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" \
|| echo "Nothing to commit, proceeding"
git push