-
Notifications
You must be signed in to change notification settings - Fork 273
82 lines (65 loc) · 2.41 KB
/
ci.yml
File metadata and controls
82 lines (65 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on: [push, pull_request]
jobs:
# Check commit lint, code lint, formatting etc.
# Used to validate before continuing the full build and test matrix.
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Lint Commits against conventional commits spec with commitlint
uses: wagoid/commitlint-github-action@v6
with:
configFile: commitlint.config.ts
- name: Setup Node.js 22.x
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint Code with ESLint
run: npm run lint
- name: Check Code Formatting with Prettier
run: npm run format:check
- name: Validate TypeScript Types
run: npm run validate-types
# Build and test against supported versions of React, Node and SVG Core.
build-and-test:
runs-on: ubuntu-latest
needs: validate
# Ensure we only run the full test matrix for pull requests and pushes to the main branch to save resources being spent on in-progress work.
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
strategy:
matrix:
free-solid-svg-icons: [7.x, 6.x]
fontawesome-svg-core: [7.x, 6.x]
node-version: [24.x, 22.x, 20.x]
react: [19.x, 18.x]
exclude:
# For v7.x core, allow all icon versions
# For v6.x exclude v7.x icons
- free-solid-svg-icons: '7.x'
fontawesome-svg-core: '6.x'
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install base dependencies
run: npm ci
- name: Install React dependencies
run: npm ci --no-save react@${{ matrix.react }} react-dom@${{ matrix.react }}
- name: Install FontAwesome dependencies
run: npm ci --no-save @fortawesome/fontawesome-svg-core@${{ matrix.fontawesome-svg-core }} @fortawesome/free-solid-svg-icons@${{ matrix.free-solid-svg-icons }}
- name: Verify React version
run: npm list react react-dom
- name: Test
run: npm run test
env:
CI: true
- name: Build
run: npm run build