chore: split ci on pull request and push action
This commit is contained in:
parent
6868465c4c
commit
76f2e149a0
|
|
@ -0,0 +1,126 @@
|
|||
name: Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
env:
|
||||
CI: true
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: pnpm/action-setup@v2.2.4
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
|
||||
- name: TypeScript check
|
||||
run: pnpm lint:tsc
|
||||
|
||||
- name: Eslint check
|
||||
run: pnpm lint:script
|
||||
|
||||
unit_test:
|
||||
name: Unit test
|
||||
env:
|
||||
CI: true
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: pnpm/action-setup@v2.2.4
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
|
||||
- name: Get cypress version
|
||||
id: cypress-version
|
||||
run: echo "version=$(pnpm info cypress version)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache cypress binary
|
||||
id: cache-cypress-binary
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/Cypress
|
||||
key: cypress-binary-${{ runner.os }}-${{ steps.cypress-version.outputs.version }}
|
||||
|
||||
- name: Install cypress binary
|
||||
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
|
||||
run: pnpm cypress install
|
||||
|
||||
- name: Unit test
|
||||
run: pnpm test:unit:ci
|
||||
|
||||
- name: Update coverage report
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
e2e_tests:
|
||||
name: E2E test
|
||||
env:
|
||||
CI: true
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: pnpm/action-setup@v2.2.4
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
|
||||
- name: Get cypress version
|
||||
id: cypress-version
|
||||
run: echo "version=$(pnpm info cypress version)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache cypress binary
|
||||
id: cache-cypress-binary
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/Cypress
|
||||
key: cypress-binary-${{ runner.os }}-${{ steps.cypress-version.outputs.version }}
|
||||
|
||||
- name: Install cypress binary
|
||||
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
|
||||
run: pnpm cypress install
|
||||
|
||||
- name: E2E test
|
||||
run: pnpm test:e2e:ci
|
||||
|
|
@ -4,9 +4,6 @@ on:
|
|||
push:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
|
|
|
|||
1444
pnpm-lock.yaml
1444
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue