[READ-ONLY] Mirror of https://github.com/danielroe/nuxt-pre-hydrate.
2.1 kB
80 lines
1name: ci
2
3on:
4 pull_request:
5 branches:
6 - main
7 push:
8 branches:
9 - main
10
11jobs:
12 lint:
13 runs-on: ubuntu-latest
14
15 steps:
16 - uses: actions/checkout@v4
17 - run: corepack enable
18 - uses: actions/setup-node@v4
19 with:
20 node-version: 18
21 cache: "pnpm"
22
23 - name: 📦 Install dependencies
24 run: pnpm install
25
26 - name: 🚧 Set up project
27 run: pnpm dev:prepare
28
29 - name: 🔠 Lint project
30 run: pnpm run lint
31
32 test:
33 runs-on: ubuntu-latest
34
35 steps:
36 - uses: actions/checkout@v4
37 - run: corepack enable
38 - uses: actions/setup-node@v4
39 with:
40 node-version: 18
41 cache: "pnpm"
42
43 - name: 📦 Install dependencies
44 run: pnpm install
45
46 # https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
47 # Install playwright's binary under custom directory to cache
48 - name: Set Playwright path (non-windows)
49 if: runner.os != 'Windows'
50 run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
51 - name: Set Playwright path (windows)
52 if: runner.os == 'Windows'
53 run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
54
55 - name: Cache Playwright's binary
56 uses: actions/cache@v4
57 with:
58 # Playwright removes unused browsers automatically
59 # So does not need to add playwright version to key
60 key: ${{ runner.os }}-playwright-bin-v1
61 path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
62
63 - name: Install Playwright
64 # does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
65 run: pnpm playwright install chromium
66
67 - name: 🚧 Set up project
68 run: pnpm dev:prepare
69
70 - name: 🧪 Test project
71 run: pnpm test -- --coverage
72
73 - name: 💪 Test types
74 run: pnpm test:types
75
76 - name: 🛠 Build project
77 run: pnpm build
78
79 - name: 🟩 Coverage
80 uses: codecov/codecov-action@v4