Vue 3, Vite, Vitest #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
unit: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version: 20.x | |
- name: Install dependencies | |
run: yarn install | |
- name: Run unit tests | |
run: yarn test:unit | |
e2e: | |
name: E2E Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Enable Corepack | |
run: corepack enable | |
- uses: cypress-io/github-action@v6 | |
with: | |
build: yarn build | |
start: npx vite preview --port 4173 | |
record: true | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
lint: | |
name: Linters | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version: 20.x | |
- name: Install dependencies | |
run: yarn install | |
- name: Run ESLint | |
run: yarn lint | |
- name: Run Stylelint | |
run: npx stylelint src/**/*.css src/**/*.vue src/**/*.scss | |
- name: Type check | |
run: yarn type-check |