Skip to content

Commit 573ba81

Browse files
committed
chore(ci): modernize
1 parent 6a70fee commit 573ba81

File tree

5 files changed

+146
-153
lines changed

5 files changed

+146
-153
lines changed

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"version": "0.2",
33
"language": "en,en-gb",
44
"words": [
5+
"amannn",
56
"Atsumu",
67
"autoprefixer",
78
"barbaz",

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
14+
cancel-in-progress: true
15+
16+
jobs:
17+
lint:
18+
name: Lint
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
27+
with:
28+
node-version: "lts/*"
29+
cache: "npm"
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build
35+
run: npm run build
36+
37+
- name: Lint
38+
run: npm run lint
39+
40+
test:
41+
name: Test - ${{ matrix.os }} (Node.js ${{ matrix.node-version }})
42+
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
os: [ubuntu-latest, windows-latest, macos-latest]
47+
node-version: [18.x, 20.x, 22.x, 24.x]
48+
49+
runs-on: ${{ matrix.os }}
50+
51+
steps:
52+
- name: Checkout code
53+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
54+
55+
- name: Setup Node.js ${{ matrix.node-version }}
56+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
57+
with:
58+
node-version: ${{ matrix.node-version }}
59+
cache: "npm"
60+
61+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4.2.0
62+
63+
- name: Install dependencies
64+
run: npm ci
65+
66+
- name: Prepare environment for tests
67+
run: npm run build:ci
68+
69+
- name: Run tests
70+
run: npm run test:coverage -- --ci
71+
72+
- name: Upload coverage to Codecov
73+
if: always()
74+
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
75+
76+
smoketests:
77+
name: Smoketests
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- name: Checkout code
82+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
83+
84+
- name: Setup Node.js
85+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
86+
with:
87+
node-version: lts/*
88+
cache: "npm"
89+
90+
- name: Install dependencies
91+
run: npm ci
92+
93+
- name: Prepare environment for tests
94+
run: npm run build:ci
95+
96+
- name: Run tests
97+
run: npm run test:smoketests

.github/workflows/commitlint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Check PR title
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- edited
9+
10+
concurrency:
11+
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
12+
cancel-in-progress: true
13+
14+
permissions:
15+
pull-requests: read
16+
17+
jobs:
18+
commitlint:
19+
name: Lint Commit Messages
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
27+
with:
28+
node-version: "lts/*"
29+
cache: "npm"
30+
31+
- run: npm ci
32+
33+
- name: Validate PR commits with commitlint
34+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
name: "Dependency Review"
2-
on: [pull_request]
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: Review Dependencies
10+
11+
on: pull_request
312

413
permissions:
514
contents: read
@@ -8,7 +17,8 @@ jobs:
817
dependency-review:
918
runs-on: ubuntu-latest
1019
steps:
11-
- name: "Checkout Repository"
20+
- name: Git Checkout
1221
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
13-
- name: "Dependency Review"
22+
23+
- name: Review Dependencies
1424
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2

.github/workflows/nodejs.yml

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)