Skip to content

Commit f141b8d

Browse files
committedNov 6, 2023
ci: add lint workflow for pushes to main
1 parent ae81407 commit f141b8d

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
 

‎.github/workflows/autofix.yml

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: autofix.ci # needed to securely identify the workflow
22

33
on:
44
pull_request:
5+
branches:
6+
- main
57

68
permissions:
79
contents: read

‎.github/workflows/ci.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

0 commit comments

Comments
 (0)
Please sign in to comment.