139 lines
2.9 KiB
YAML
139 lines
2.9 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- '**.md'
|
|
pull_request:
|
|
paths-ignore:
|
|
- '**.md'
|
|
|
|
env:
|
|
CI: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
run_install: false
|
|
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: TypeScript check
|
|
run: pnpm type-check
|
|
|
|
- name: Eslint check
|
|
run: pnpm lint
|
|
|
|
unit_test:
|
|
name: Unit test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
run_install: false
|
|
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Unit test
|
|
run: pnpm test:unit
|
|
|
|
- name: Update coverage report
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
cypress_e2e_tests:
|
|
name: Cypress E2E test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
run_install: false
|
|
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- 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@v4
|
|
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:cypress
|
|
|
|
playwright_e2e_tests:
|
|
name: Playwright E2E test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
run_install: false
|
|
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Install playwright binary
|
|
run: pnpm playwright install --with-deps
|
|
|
|
- name: E2E test
|
|
run: pnpm test:playwright
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 30
|