Skip to content

Commit 0fcb328

Browse files
authored
Create main.yml
1 parent e253e9f commit 0fcb328

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
actions: write
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
24+
with:
25+
node-version: "22"
26+
27+
- name: Install pnpm
28+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
29+
with:
30+
version: latest
31+
run_install: false
32+
33+
- name: Get pnpm store directory
34+
id: pnpm-cache
35+
shell: bash
36+
run: |
37+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
38+
39+
- name: Setup pnpm cache
40+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
41+
with:
42+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
43+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
restore-keys: |
45+
${{ runner.os }}-pnpm-store-
46+
47+
- name: Install dependencies
48+
run: pnpm install
49+
50+
- name: Build
51+
run: pnpm build
52+
53+
- name: Lint
54+
run: pnpm lint

0 commit comments

Comments
 (0)