Skip to content

Commit fbefa33

Browse files
authored
feat(ci): add asdf tools to github actions (#408)
1 parent e2b23f2 commit fbefa33

File tree

4 files changed

+933
-695
lines changed

4 files changed

+933
-695
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'setup-asdf-tools'
2+
description: 'Composite action to setup asdf tools listed in .tool-versions'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: 🤹‍♂️ Install asdf
8+
uses: asdf-vm/actions/setup@v2
9+
10+
- name: 🗂️ Cache asdf
11+
id: cache-asdf
12+
uses: actions/cache@v3
13+
with:
14+
path: ~/.asdf/
15+
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}
16+
17+
- name: 🛠️ Install tools from .tool-versions
18+
if: steps.cache-asdf.outputs.cache-hit != 'true'
19+
uses: asdf-vm/actions/install@v2

.github/workflows/ci.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@ jobs:
1414
validate:
1515
name: ✅ Validate project
1616
runs-on: ubuntu-latest
17-
strategy:
18-
matrix:
19-
node-version: [16.x, 18.x]
2017

2118
steps:
2219
- name: ⬇️ Checkout project
2320
uses: actions/checkout@v4
2421

25-
- name: 🟢 Setup NodeJS ${{ matrix.node-version }}
26-
uses: actions/setup-node@v3
27-
with:
28-
node-version: ${{ matrix.node-version }}
29-
cache: npm
22+
- name: 🛠️ Setup asdf tools
23+
uses: ./.github/actions/setup-asdf-tools
3024

3125
- name: 📥 Install dependencies
3226
run: npm ci
@@ -56,19 +50,13 @@ jobs:
5650
name: 🧑‍🔬 Test project
5751
runs-on: ubuntu-latest
5852
needs: validate
59-
strategy:
60-
matrix:
61-
node-version: [16.x, 18.x]
6253

6354
steps:
6455
- name: ⬇️ Checkout project
6556
uses: actions/checkout@v4
6657

67-
- name: 🟢 Setup NodeJS ${{ matrix.node-version }}
68-
uses: actions/setup-node@v3
69-
with:
70-
node-version: ${{ matrix.node-version }}
71-
cache: npm
58+
- name: 🛠️ Setup asdf tools
59+
uses: ./.github/actions/setup-asdf-tools
7260

7361
- name: 📥 Install dependencies
7462
run: npm ci
@@ -83,19 +71,13 @@ jobs:
8371
name: 🧰 Build project
8472
runs-on: ubuntu-latest
8573
needs: test
86-
strategy:
87-
matrix:
88-
node-version: [16.x, 18.x]
8974

9075
steps:
9176
- name: ⬇️ Checkout project
9277
uses: actions/checkout@v4
9378

94-
- name: 🟢 Setup NodeJS ${{ matrix.node-version }}
95-
uses: actions/setup-node@v3
96-
with:
97-
node-version: ${{ matrix.node-version }}
98-
cache: npm
79+
- name: 🛠️ Setup asdf tools
80+
uses: ./.github/actions/setup-asdf-tools
9981

10082
- name: 📥 Install dependencies
10183
run: npm ci

0 commit comments

Comments
 (0)