Merge branch 'master' into script-setup

This commit is contained in:
mutoe 2021-02-28 15:04:57 +08:00
commit 0cb382c81e
4 changed files with 140 additions and 17 deletions

View File

@ -1,9 +1,16 @@
name: Node CI
name: Deploy
on: [push]
on:
workflow_run:
workflows: ["Test"]
branches: [master]
types: [completed]
jobs:
build:
deploy:
# https://github.community/t/workflow-run-success-type-reference/133194
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
CI: true
@ -32,18 +39,6 @@ jobs:
- name: Install dependencies
run: yarn install --skip-integrity-check --non-interactive --no-progress
- name: TypeScript check
run: yarn tsc
- name: Eslint check
run: yarn lint:script
- name: Vetur check
run: yarn lint:vti
- name: Unit test
run: yarn test:unit
- name: Build
run: |
yarn build --base=/vue3-realworld-example-app/

124
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,124 @@
name: Test
on: [push]
jobs:
lint:
name: Lint
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 14.x
uses: actions/setup-node@v1
with:
node-version: 14.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: TypeScript check
run: yarn tsc
- name: Eslint check
run: yarn lint:script
- name: Vetur check
run: yarn lint:vti
unit_test:
name: Unit 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 14.x
uses: actions/setup-node@v1
with:
node-version: 14.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: Unit test
run: yarn test:unit
- name: Update coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
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 14.x
uses: actions/setup-node@v1
with:
node-version: 14.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: Build
run: yarn build
- name: E2E test
uses: cypress-io/github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
with:
config: baseUrl=http://localhost:5000
start: yarn serve dist
wait-on: http://localhost:5000

View File

@ -1,7 +1,10 @@
# ![RealWorld Example App](logo.png)
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/mutoe/vue3-realworld-example-app/Node%20CI/master?label=master%20branch&logo=github&style=for-the-badge)
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/mutoe/vue3-realworld-example-app/Node%20CI/script-setup?label=script%20setup%20branch&logo=github&style=for-the-badge)
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/mutoe/vue3-realworld-example-app/Test/master?label=master&logo=github&style=for-the-badge)
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/mutoe/vue3-realworld-example-app/Test/script-setup?label=script-setup&logo=github&style=for-the-badge)
![Codecov branch](https://img.shields.io/codecov/c/github/mutoe/vue3-realworld-example-app/master?label=master&logo=codecov&style=flat-square)
![Codecov branch](https://img.shields.io/codecov/c/github/mutoe/vue3-realworld-example-app/script-setup?label=script-setup&logo=codecov&style=flat-square)
> ### [Vue3](https://v3.vuejs.org/) codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the [RealWorld](https://github.com/gothinkster/realworld) spec and API.

View File

@ -1,3 +1,4 @@
{
"projectId": "j7s91r",
"baseUrl": "http://localhost:3000"
}