ci: add health check pipeline

This commit is contained in:
mutoe 2022-06-12 01:05:41 +08:00
parent 606cb8e764
commit 5f725fa878
No known key found for this signature in database
GPG Key ID: 7197231B847AE2EE
2 changed files with 40 additions and 0 deletions

39
.github/workflows/health-check.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Check Swagger API
on:
schedule:
- cron: '35 17 */4 * 4'
jobs:
e2e_tests:
name: E2E test
env:
CI: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --skip-integrity-check --non-interactive --no-progress
- name: E2E test
run: yarn test:e2e:prod

View File

@ -14,6 +14,7 @@
"test:unit:ci": "cypress run --component --quiet --reporter spec",
"test:e2e": "yarn build && concurrently -rk -s first \"yarn serve\" \"cypress open --e2e -c baseUrl=http://localhost:4137\"",
"test:e2e:ci": "yarn build && concurrently -rk -s first \"yarn serve\" \"cypress run --e2e -c baseUrl=http://localhost:4137\"",
"test:e2e:prod": "cypress run --e2e -c baseUrl=https://vue3-realworld-example-app-mutoe.vercel.app",
"test": "yarn test:unit:ci && yarn test:e2e:ci",
"generate:api": "sta -p https://raw.githubusercontent.com/gothinkster/realworld/main/api/openapi.yml -o ./src/services -n api.ts"
},