Skip to content

Commit 6025d95

Browse files
authored
chore: use composite action for setup env (#420)
1 parent 13588e6 commit 6025d95

File tree

16 files changed

+93
-221
lines changed

16 files changed

+93
-221
lines changed

.github/actions/setup-workspace/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ description: Setup Node.js and install dependencies
44
runs:
55
using: composite
66
steps:
7-
- uses: actions/checkout@v4
8-
with:
9-
fetch-depth: 0
10-
117
- name: Setup Node.js
128
uses: actions/setup-node@v4
139
with:

.github/workflows/deploy.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,12 @@ jobs:
1414
issues: write
1515
pull-requests: write
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Setup node
22-
uses: actions/setup-node@v3
23-
with:
24-
node-version: 22
25-
26-
- name: Install dependencies
27-
run: |
28-
corepack enable
29-
corepack prepare --activate
30-
pnpm install --frozen-lockfile
21+
- name: Setup Environment
22+
uses: ./.github/actions/setup-workspace
3123

3224
- name: Build example project
3325
run: pnpm --filter examples build:deploy

.github/workflows/publish.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,16 @@ jobs:
1313
contents: write
1414
packages: write
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919

2020
- name: Extract version number
2121
id: vars
2222
run: echo ::set-output name=version::$(jq -r .version package.json)
2323

24-
- name: Setup node
25-
uses: actions/setup-node@v3
26-
with:
27-
node-version: 22
28-
registry-url: "https://npm.pkg.github.com"
29-
scope: "@axiscommunications"
30-
31-
- name: Install dependencies
32-
run: |
33-
corepack enable
34-
corepack prepare --activate
35-
pnpm install --frozen-lockfile
24+
- name: Setup Environment
25+
uses: ./.github/actions/setup-workspace
3626

3727
- name: Build
3828
env:

.github/workflows/verify-icons.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919

20-
- name: Setup node
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: 22
24-
25-
- name: Install dependencies
26-
run: |
27-
corepack enable
28-
corepack prepare --activate
29-
pnpm install --frozen-lockfile
20+
- name: Setup Environment
21+
uses: ./.github/actions/setup-workspace
3022

3123
- name: Transform SVG to fonts
3224
run: pnpm --filter @axiscommunications/fluent-icons fonts:build

.github/workflows/verify-illustrations.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919

20-
- name: Setup node
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: 22
24-
25-
- name: Install dependencies
26-
run: |
27-
corepack enable
28-
corepack prepare --activate
29-
pnpm install --frozen-lockfile
20+
- name: Setup Environment
21+
uses: ./.github/actions/setup-workspace
3022

3123
- name: Transform SVG to react components
3224
run: pnpm --filter @axiscommunications/fluent-illustrations illustrations:build-react

.github/workflows/verify-page.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,12 @@ jobs:
1414
verify-gh-page:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Setup node
22-
uses: actions/setup-node@v3
23-
with:
24-
node-version: 22
25-
26-
- name: Install dependencies
27-
run: |
28-
corepack enable
29-
corepack prepare --activate
30-
pnpm install --frozen-lockfile
21+
- name: Setup Environment
22+
uses: ./.github/actions/setup-workspace
3123

3224
- name: Run Playwright tests
3325
run: pnpm stest

.github/workflows/verify-tokens.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919

20-
- name: Setup node
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: 22
24-
25-
- name: Install dependencies
26-
run: |
27-
corepack enable
28-
corepack prepare --activate
29-
pnpm install --frozen-lockfile
20+
- name: Setup Environment
21+
uses: ./.github/actions/setup-workspace
3022

3123
- name: Build theme library and token generator
3224
run: pnpm --filter @axiscommunications/fluent-theme build

.github/workflows/verify.yml

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,93 @@ on:
99
- main
1010

1111
jobs:
12-
unit-tests:
12+
check-commit:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
1718
with:
1819
fetch-depth: 0
19-
20-
- name: Setup node
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: 22
24-
25-
- name: Install dependencies
26-
run: |
27-
corepack enable
28-
corepack prepare --activate
29-
pnpm install --frozen-lockfile
20+
21+
- name: Setup Environment
22+
uses: ./.github/actions/setup-workspace
3023

3124
- name: Check commit message
3225
if: ${{ github.event_name == 'pull_request' }}
3326
run: pnpm commitlint ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
3427

35-
- name: Build, linting & Unit testing
28+
lint:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Setup Environment
37+
uses: ./.github/actions/setup-workspace
38+
39+
- name: Lint
3640
env:
3741
NODE_OPTIONS: "--max-old-space-size=4096"
3842
run: |
3943
git diff --exit-code
4044
pnpm build
4145
pnpm check
46+
47+
build:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
55+
- name: Setup Environment
56+
uses: ./.github/actions/setup-workspace
57+
58+
- name: Build
59+
env:
60+
NODE_OPTIONS: "--max-old-space-size=4096"
61+
run: |
62+
git diff --exit-code
63+
pnpm build
64+
65+
unit-tests:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout repository
69+
uses: actions/checkout@v4
70+
with:
71+
fetch-depth: 0
72+
73+
- name: Setup Environment
74+
uses: ./.github/actions/setup-workspace
75+
76+
- name: Test
77+
env:
78+
NODE_OPTIONS: "--max-old-space-size=4096"
79+
run: |
80+
git diff --exit-code
81+
pnpm build
4282
pnpm test
83+
84+
check-deps:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- name: Checkout repository
88+
uses: actions/checkout@v4
89+
with:
90+
fetch-depth: 0
91+
92+
- name: Setup Environment
93+
uses: ./.github/actions/setup-workspace
94+
95+
- name: check unused dependencies
96+
env:
97+
NODE_OPTIONS: "--max-old-space-size=4096"
98+
run: |
99+
git diff --exit-code
100+
pnpm check:unused-deps
101+

components/slider/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"check:unused-deps": "depcheck . --config=depcheck.yml",
2626
"lint": "tsc --noEmit && biome check",
2727
"test": "vitest run",
28-
"test:coverage": "vitest run --coverage",
2928
"test:update-snapshots": "vitest -u",
3029
"test:watch": "vitest watch"
3130
},
@@ -35,7 +34,6 @@
3534
"@testing-library/user-event": "^14.6.1",
3635
"@types/react": "^18.3.12",
3736
"@types/react-dom": "^18.3.1",
38-
"@vitest/coverage-v8": "^3.0.8",
3937
"esbuild": "^0.25.0",
4038
"jsdom": "^26.0.0",
4139
"react": "^18.2.0",

components/stepper/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@
2525
"check:unused-deps": "depcheck . --config=depcheck.yml",
2626
"lint": "tsc --noEmit && biome check",
2727
"test": "vitest run",
28-
"test:coverage": "vitest run --coverage",
2928
"test:watch": "vitest watch"
3029
},
3130
"devDependencies": {
3231
"@testing-library/jest-dom": "^6.6.3",
3332
"@testing-library/react": "^14.2.1",
3433
"@types/react": "^18.3.12",
3534
"@types/react-dom": "^18.3.1",
36-
"@vitest/coverage-v8": "^3.0.8",
3735
"esbuild": "^0.25.0",
3836
"jsdom": "^26.0.0",
3937
"react": "^18.2.0",

0 commit comments

Comments
 (0)