Skip to content

Commit f50c1b5

Browse files
committed
ci: run lint + test actions in ci
1 parent 3f96e97 commit f50c1b5

File tree

3 files changed

+96
-1
lines changed

3 files changed

+96
-1
lines changed

.github/workflows/autofix.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: autofix.ci # needed to securely identify the workflow
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
17+
- run: corepack enable
18+
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
19+
with:
20+
node-version: 20
21+
cache: "pnpm"
22+
23+
- name: Install dependencies
24+
run: pnpm install
25+
26+
- name: Lint (code)
27+
run: pnpm lint --fix
28+
29+
- uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml
12+
env:
13+
# 7 GiB by default on GitHub, setting to 6 GiB
14+
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
15+
NODE_OPTIONS: --max-old-space-size=6144
16+
# install playwright binary manually (because pnpm only runs install script once)
17+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
18+
19+
20+
# Remove default permissions of GITHUB_TOKEN for security
21+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
22+
permissions: {}
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
26+
cancel-in-progress: ${{ github.event_name != 'push' }}
27+
28+
jobs:
29+
lint:
30+
# autofix workflow will be triggered instead for PRs
31+
if: github.event_name == 'push'
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
36+
- run: corepack enable
37+
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
38+
with:
39+
node-version: 20
40+
cache: "pnpm"
41+
42+
- name: Install dependencies
43+
run: pnpm install
44+
45+
- name: Lint
46+
run: pnpm lint
47+
48+
test:
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
53+
- run: corepack enable
54+
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
55+
with:
56+
node-version: 20
57+
cache: "pnpm"
58+
59+
- name: Install dependencies
60+
run: pnpm install
61+
62+
- name: Prepare module environment
63+
run: pnpm dev:prepare
64+
65+
- name: Run test suite
66+
run: pnpm test

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@
4747
"nuxt": "^3.8.0",
4848
"vitest": "^0.33.0"
4949
}
50-
}
50+
}

0 commit comments

Comments
 (0)