Skip to content

Commit 2d8c262

Browse files
committed
actions
1 parent f139a66 commit 2d8c262

File tree

4 files changed

+30
-39
lines changed

4 files changed

+30
-39
lines changed

.github/actions/setup/action.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
runs:
2+
using: composite
3+
steps:
4+
- name: Install node
5+
uses: actions/setup-node@v4
6+
with:
7+
node-version: 18
8+
- name: Install yarn
9+
run: npm install -g yarn
10+
shell: bash
11+
- name: Enable Corepack
12+
run: corepack enable
13+
shell: bash
14+
- name: Cache
15+
uses: actions/cache@v4
16+
id: cache
17+
with:
18+
path: '**/node_modules'
19+
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
20+
- name: Install
21+
working-directory: ${{ inputs.working-directory }}
22+
run: yarn --immutable
23+
shell: bash
24+
if: steps.cache.outputs.cache-hit != 'true'

.github/workflows/build.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Install node
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: 18
19-
- name: Cache
20-
uses: actions/cache@v4
21-
id: cache
22-
with:
23-
path: '**/node_modules'
24-
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
25-
- name: Install
26-
run: yarn --immutable
27-
if: steps.cache.outputs.cache-hit != 'true'
15+
- name: Set up environment
16+
uses: ./.github/actions/setup
2817
- name: Build
2918
run: yarn build

.github/workflows/lint.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Install node
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: 18
19-
- name: Cache
20-
uses: actions/cache@v4
21-
id: cache
22-
with:
23-
path: '**/node_modules'
24-
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
25-
- name: Install
26-
run: yarn --immutable
27-
if: steps.cache.outputs.cache-hit != 'true'
15+
- name: Set up environment
16+
uses: ./.github/actions/setup
2817
- name: Lint
2918
run: yarn lint

.github/workflows/test.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Install node
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: 18
19-
- name: Cache
20-
uses: actions/cache@v4
21-
id: cache
22-
with:
23-
path: '**/node_modules'
24-
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
25-
- name: Install
26-
run: yarn --immutable
27-
if: steps.cache.outputs.cache-hit != 'true'
15+
- name: Set up environment
16+
uses: ./.github/actions/setup
2817
- name: Test
2918
run: yarn test:ci

0 commit comments

Comments
 (0)