-
Notifications
You must be signed in to change notification settings - Fork 36
124 lines (100 loc) · 3.7 KB
/
verify.yml
File metadata and controls
124 lines (100 loc) · 3.7 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Verify
on:
push:
branches:
- '**'
- '!**--skip-ci'
- '!**--visual-reports'
- '!wip/**'
- '!experiments/**'
pull_request:
branches:
- 'portal'
- 'release'
- 'beta'
- 'alpha'
- 'next'
types: [opened]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GH_EMAIL: ${{ secrets.GH_EMAIL }}
GH_NAME: ${{ secrets.GH_NAME }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
FIGMA_ICONS_FILE: ${{ secrets.FIGMA_ICONS_FILE }}
jobs:
verify:
name: Run tests and checks
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Git checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version-file: 'package.json'
- name: Use node_modules cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
id: modules-cache
with:
path: node_modules
key: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-modules-
- name: Install dependencies
if: steps.modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Audit dependencies
if: ${{ !contains(github.event.head_commit.message || '', '--skip-audit') && !(github.event.pull_request && contains(github.event.pull_request.title || '', '--skip-audit')) }}
run: yarn workspace @dnb/eufemia audit:ci
- name: Run lint
run: |
yarn workspace @dnb/eufemia lint:ci
yarn workspace dnb-design-system-portal lint:ci
- name: Run type checks
run: |
yarn workspace @dnb/eufemia test:types
yarn workspace dnb-design-system-portal test:types
yarn workspace eufemia-llm-metadata test:types
- name: Run tests
run: |
yarn workspace @dnb/eufemia test:ci
yarn workspace dnb-design-system-portal test:ci
yarn workspace markdown-tables-utils test
yarn workspace eufemia-llm-metadata test
- name: Run dependency checks
run: yarn workspace @dnb/eufemia test:deps
build-check:
name: Run build tests
runs-on: ubuntu-latest
steps:
- name: Git checkout (with fetch-depth)
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
fetch-depth: 20 # The "postbuild:ci" method "getCommittedFiles" needs all history
- name: Use Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version-file: 'package.json'
- name: Use node_modules cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
id: modules-cache
with:
path: node_modules
key: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-modules-
- name: Install dependencies
if: steps.modules-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Verify isCI
run: yarn workspace repo-utils test:ci
- name: Prebuild Library
run: yarn workspace @dnb/eufemia prebuild:ci
- name: Postbuild Library
run: yarn workspace @dnb/eufemia postbuild:ci