127 lines
2.8 KiB
YAML
127 lines
2.8 KiB
YAML
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
|