42
42
if : steps.cache-node-modules.outputs.cache-hit == 'true'
43
43
run : |
44
44
npm run build -w packages/commons
45
- npm run build -w packages/logger & npm run build -w packages/tracer & npm run build -w packages/metrics & npm run build -w packages/parameters & npm run build -w packages/idempotency & npm run build -w docs/snippets
45
+ npm run build -w packages/logger & npm run build -w packages/tracer & npm run build -w packages/metrics & npm run build -w packages/parameters & npm run build -w packages/idempotency
46
46
- name : Run linting
47
- run : npm run lint -w packages/commons -w packages/logger -w packages/tracer -w packages/metrics -w packages/parameters -w packages/idempotency -w docs/snippets
47
+ run : npm run lint -w packages/commons -w packages/logger -w packages/tracer -w packages/metrics -w packages/parameters -w packages/idempotency
48
48
- name : Run unit tests
49
49
run : npm t -w packages/commons -w packages/logger -w packages/tracer -w packages/metrics -w packages/parameters -w packages/idempotency
50
50
check-examples :
64
64
- name : Setup NodeJS
65
65
uses : actions/setup-node@v3
66
66
with :
67
- node-version : 16
67
+ node-version : 18
68
68
cache : " npm"
69
69
- name : Cache node modules
70
70
id : cache-node-modules
97
97
- name : Setup NodeJS
98
98
uses : actions/setup-node@v3
99
99
with :
100
- node-version : 16
100
+ node-version : 18
101
101
cache : " npm"
102
102
- name : Cache node modules
103
103
id : cache-node-modules
@@ -114,3 +114,40 @@ jobs:
114
114
run : npm run lint
115
115
- name : Run tests
116
116
run : npm t
117
+ check-docs-snippets :
118
+ runs-on : ubuntu-latest
119
+ env :
120
+ NODE_ENV : dev
121
+ steps :
122
+ - name : Checkout code
123
+ uses : actions/checkout@v3
124
+ - name : Setup NodeJS
125
+ uses : actions/setup-node@v3
126
+ with :
127
+ node-version : 18
128
+ cache : " npm"
129
+ - name : Setup npm
130
+ run : npm i -g npm@next-8
131
+ - name : Cache node modules
132
+ id : cache-node-modules
133
+ uses : actions/cache@v3
134
+ with :
135
+ path : " ./node_modules"
136
+ # Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
137
+ # if one of them changes the cache is invalidated/discarded
138
+ key : 18-cache-utilities-node-modules-${{ hashFiles('./package-lock.json') }}
139
+ - name : Install dependencies
140
+ # We can skip the installation if there was a cache hit
141
+ if : steps.cache-node-modules.outputs.cache-hit != 'true'
142
+ # See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
143
+ run : npm ci --foreground-scripts
144
+ - name : Build packages
145
+ # If there's a cache hit we still need to manually build the packages
146
+ # this would otherwise have been done automatically as a part of the
147
+ # post-install npm hook
148
+ if : steps.cache-node-modules.outputs.cache-hit == 'true'
149
+ run : |
150
+ npm run build -w packages/commons
151
+ npm run build -w packages/logger & npm run build -w packages/tracer & npm run build -w packages/metrics & npm run build -w packages/parameters & npm run build -w packages/idempotency & npm run build -w docs/snippets
152
+ - name : Run linting
153
+ run : npm run lint -w packages/commons -w packages/logger -w packages/tracer -w packages/metrics -w packages/parameters -w packages/idempotency -w docs/snippets
0 commit comments