Skip to content

Commit 81d3e60

Browse files
authored
ci: improve jobs definition (#17)
* ci: add package publishing automation job timeout * ci: update node version to the lates LTS available * ci: add npm cache to the publishing job
1 parent 5a929da commit 81d3e60

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

.github/workflows/ci.yml

+6-18
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,39 @@
11
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
22
name: CI
3-
43
on:
54
push:
65
branches:
76
- main
87
pull_request:
9-
108
jobs:
119
lint-test:
1210
name: 🚀 Lint and test
1311
runs-on: ubuntu-latest
1412
timeout-minutes: 5
15-
strategy:
16-
matrix:
17-
node: [ 18, 20 ]
18-
1913
steps:
20-
- name: 👍 Checkout
21-
uses: actions/checkout@v4
22-
23-
- name: 🐢 Setup node.js
24-
uses: actions/setup-node@v4
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
2516
with:
26-
node-version: ${{ matrix.node }}
27-
cache: 'npm'
28-
17+
node-version: lts/*
18+
cache: npm
2919
- name: 📥 Install dependencies
3020
run: npm install
31-
3221
- name: 💅 Lint code style
3322
run: npm run lint
34-
3523
- name: ✅ Run tests
3624
run: npm run test
37-
3825
publish:
3926
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
4027
name: 📦 Publish
4128
runs-on: ubuntu-latest
4229
needs: lint-test
30+
timeout-minutes: 5
4331
permissions:
4432
# Needed by googleapis/release-please-action@v4
4533
contents: write
4634
pull-requests: write
4735
# Needed by `npm publish --provenance`
4836
id-token: write
49-
5037
steps:
5138
- name: 🍄 Bump package version, create GitHub release, and update changelog
5239
uses: googleapis/release-please-action@v4
@@ -57,6 +44,7 @@ jobs:
5744
if: ${{ steps.release.outputs.release_created }}
5845
with:
5946
node-version: lts/*
47+
cache: npm
6048
registry-url: https://registry.npmjs.org
6149
- name: 🚀 Publish to npm
6250
if: ${{ steps.release.outputs.release_created }}

0 commit comments

Comments
 (0)