Skip to content

Commit faeb72d

Browse files
committed
add _setup.yml
1 parent 5ab7be5 commit faeb72d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/_setup.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on: workflow_call
2+
3+
jobs:
4+
install:
5+
runs-on: ubuntu-latest
6+
outputs:
7+
yarn-cache-dir: ${{ steps.yarn-cache-dir-path.outputs.dir }}
8+
steps:
9+
- uses: actions/checkout@v4
10+
- id: yarn-cache-dir-path
11+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 20.x
15+
- uses: actions/cache@v4
16+
id: yarn-cache
17+
with:
18+
path: |
19+
${{ github.workspace }}/node_modules
20+
${{ steps.yarn-cache-dir-path.outputs.dir }}
21+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-nodemodules
22+
- name: Install packages
23+
if: steps.yarn-cache.outputs.cache-hit != 'true'
24+
run: yarn install --immutable
25+
26+
check:
27+
runs-on: ubuntu-latest
28+
needs: install
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/cache@v4
32+
with:
33+
path: |
34+
${{ github.workspace }}/node_modules
35+
${{ needs.install.outputs.yarn-cache-dir }}
36+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-nodemodules
37+
- name: tsc/lint/format check
38+
run: yarn tsc && yarn run biome ci .

0 commit comments

Comments
 (0)