Skip to content

Commit bf350be

Browse files
authored
Merge pull request #3 from oss-serverless/update-node-versions
Update versions in GitHub Actions
2 parents b4599b2 + c318cb3 commit bf350be

File tree

3 files changed

+59
-119
lines changed

3 files changed

+59
-119
lines changed

.github/workflows/integrate.yml

Lines changed: 26 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ env:
1212
SLS_SCHEMA_CACHE_BASE_DIR: '/home/runner'
1313

1414
jobs:
15-
linuxNode16:
16-
name: '[Linux] Node.js 16: Publish canary, Unit & packaging tests '
15+
linuxNode22:
16+
name: '[Linux] Node 22: Publish canary, Unit & packaging tests '
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121

2222
- name: Install Node.js and npm
23-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
2424
with:
25-
node-version: 16.x
25+
node-version: 22.x
2626
registry-url: https://registry.npmjs.org
2727

2828
- name: Publish canary
@@ -37,13 +37,13 @@ jobs:
3737
3838
- name: Retrieve dependencies from cache
3939
id: cacheNpm
40-
uses: actions/cache@v3
40+
uses: actions/cache@v4
4141
with:
4242
path: |
4343
~/.npm
4444
node_modules
45-
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
46-
restore-keys: npm-v16-${{ runner.os }}-${{ github.ref }}-
45+
key: npm-v22-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
46+
restore-keys: npm-v22-${{ runner.os }}-${{ github.ref }}-
4747

4848
- name: Install dependencies
4949
if: steps.cacheNpm.outputs.cache-hit != 'true'
@@ -58,15 +58,15 @@ jobs:
5858
run: npm run integration-test-run-package
5959

6060
windowsNode16:
61-
name: '[Windows] Node.js v16: Unit tests'
61+
name: '[Windows] Node 16: Unit tests'
6262
runs-on: windows-latest
6363
steps:
6464
- name: Checkout repository
65-
uses: actions/checkout@v3
65+
uses: actions/checkout@v4
6666

6767
- name: Retrieve dependencies from cache
6868
id: cacheNpm
69-
uses: actions/cache@v3
69+
uses: actions/cache@v4
7070
with:
7171
path: |
7272
~/.npm
@@ -75,7 +75,7 @@ jobs:
7575
restore-keys: npm-v16-${{ runner.os }}-${{ github.ref }}-
7676

7777
- name: Install Node.js and npm
78-
uses: actions/setup-node@v3
78+
uses: actions/setup-node@v4
7979
with:
8080
node-version: 16.x
8181

@@ -87,27 +87,27 @@ jobs:
8787
- name: Unit tests
8888
run: npm test -- -b
8989

90-
linuxNode14:
91-
name: '[Linux] Node.js 14: Isolated unit tests'
90+
linuxNode16:
91+
name: '[Linux] Node 16: Isolated unit tests'
9292
runs-on: ubuntu-latest
9393
steps:
9494
- name: Checkout repository
95-
uses: actions/checkout@v3
95+
uses: actions/checkout@v4
9696

9797
- name: Retrieve dependencies from cache
9898
id: cacheNpm
99-
uses: actions/cache@v3
99+
uses: actions/cache@v4
100100
with:
101101
path: |
102102
~/.npm
103103
node_modules
104-
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
105-
restore-keys: npm-v14-${{ runner.os }}-${{ github.ref }}-
104+
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
105+
restore-keys: npm-v16-${{ runner.os }}-${{ github.ref }}-
106106

107107
- name: Install Node.js and npm
108-
uses: actions/setup-node@v3
108+
uses: actions/setup-node@v4
109109
with:
110-
node-version: 14.x
110+
node-version: 16.x
111111

112112
- name: Install dependencies
113113
if: steps.cacheNpm.outputs.cache-hit != 'true'
@@ -119,40 +119,10 @@ jobs:
119119
# Workaround taken from https://github.com/actions/runner/issues/241#issuecomment-577360161
120120
run: script -e -c "npm run test:isolated -- -b"
121121

122-
linuxNode12:
123-
name: '[Linux] Node.js v12: Node version validation test'
124-
runs-on: ubuntu-latest
125-
steps:
126-
- name: Checkout repository
127-
uses: actions/checkout@v3
128-
129-
- name: Install Node.js and npm
130-
uses: actions/setup-node@v3
131-
with:
132-
node-version: 12.x
133-
134-
- name: Node version validation test
135-
run: ./bin/serverless.js 2>&1 | grep -q "does not support"
136-
137-
linuxNode4:
138-
name: '[Linux] Node.js v4: Node version validation test'
139-
runs-on: ubuntu-latest
140-
steps:
141-
- name: Checkout repository
142-
uses: actions/checkout@v3
143-
144-
- name: Install Node.js and npm
145-
uses: actions/setup-node@v3
146-
with:
147-
node-version: 4.x
148-
149-
- name: Node version validation test
150-
run: ./bin/serverless.js 2>&1 | grep -q "does not support"
151-
152122
integrate:
153123
name: Integrate
154124
runs-on: ubuntu-latest
155-
needs: [linuxNode16, windowsNode16, linuxNode14, linuxNode12, linuxNode4]
125+
needs: [linuxNode22, windowsNode22, linuxNode16]
156126
timeout-minutes: 30 # Default is 360
157127
env:
158128
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -161,7 +131,7 @@ jobs:
161131
SERVERLESS_BINARY_PATH: ./dist/serverless-linux
162132
steps:
163133
- name: Checkout repository
164-
uses: actions/checkout@v3
134+
uses: actions/checkout@v4
165135
with:
166136
# Ensure to have complete history of commits pushed with given push operation
167137
# It's loose and imperfect assumption that no more than 30 commits will be pushed at once
@@ -171,22 +141,22 @@ jobs:
171141
token: ${{ secrets.USER_GITHUB_TOKEN }}
172142

173143
- name: Retrieve dependencies from cache
174-
uses: actions/cache@v3
144+
uses: actions/cache@v4
175145
with:
176146
path: |
177147
~/.npm
178148
node_modules
179-
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
149+
key: npm-v22-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
180150

181151
# Potentially needed for test/integration/curated-plugins-python.test.js
182152
- uses: actions/setup-python@v4
183153
with:
184154
python-version: '3.11'
185155

186156
- name: Install Node.js and npm
187-
uses: actions/setup-node@v3
157+
uses: actions/setup-node@v4
188158
with:
189-
node-version: 16.x
159+
node-version: 22.x
190160

191161
# Note: No need to install dependencies as we have retrieved cached `node_modules` for very
192162
# same `package.json` as stored with previous job

.github/workflows/publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515

1616
- name: Retrieve dependencies from cache
17-
uses: actions/cache@v3
17+
uses: actions/cache@v4
1818
id: cacheNpm
1919
with:
2020
path: |
2121
~/.npm
2222
node_modules
23-
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
23+
key: npm-v22-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
2424

2525
- name: Install Node.js and npm
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2727
with:
28-
node-version: 16.x
28+
node-version: 22.x
2929
registry-url: https://registry.npmjs.org
3030

3131
- name: Install dependencies
@@ -56,28 +56,28 @@ jobs:
5656
script -e -c "npm test -- -b"
5757
5858
npmPublish:
59-
name: Publish to npm
59+
name: Publish to NPM
6060
needs: prePublishPackageTest
6161
runs-on: ubuntu-latest
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6464
steps:
6565
- name: Checkout repository
66-
uses: actions/checkout@v3
66+
uses: actions/checkout@v4
6767

6868
- name: Retrieve dependencies from cache
69-
uses: actions/cache@v3
69+
uses: actions/cache@v4
7070
id: cacheNpm
7171
with:
7272
path: |
7373
~/.npm
7474
node_modules
75-
key: npm-v16-${{ runner.os }}-refs/heads/main-${{ hashFiles('package.json') }}
75+
key: npm-v22-${{ runner.os }}-refs/heads/main-${{ hashFiles('package.json') }}
7676

7777
- name: Install Node.js and npm
78-
uses: actions/setup-node@v3
78+
uses: actions/setup-node@v4
7979
with:
80-
node-version: 16.x
80+
node-version: 22.x
8181
registry-url: https://registry.npmjs.org
8282

8383
# Normally we have a guarantee that deps are already there, still it may not be the case when:

.github/workflows/validate.yml

Lines changed: 22 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ env:
1414
SLS_SCHEMA_CACHE_BASE_DIR: '/home/runner'
1515

1616
jobs:
17-
linuxNode16:
18-
name: '[Linux] Node.js 16: Lint, Formatting, Eventual Changelog, Unit & packaging tests'
17+
linuxNode22:
18+
name: '[Linux] Node 22: Lint, Formatting, Changelog, Unit & packaging tests'
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 30
2525

@@ -32,20 +32,20 @@ jobs:
3232
3333
- name: Retrieve dependencies from cache
3434
id: cacheNpm
35-
uses: actions/cache@v3
35+
uses: actions/cache@v4
3636
with:
3737
path: |
3838
~/.npm
3939
node_modules
40-
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
40+
key: npm-v22-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
4141
restore-keys: |
42-
npm-v16-${{ runner.os }}-${{ github.ref }}-
43-
npm-v16-${{ runner.os }}-refs/heads/main-
42+
npm-v22-${{ runner.os }}-${{ github.ref }}-
43+
npm-v22-${{ runner.os }}-refs/heads/main-
4444
4545
- name: Install Node.js and npm
46-
uses: actions/setup-node@v3
46+
uses: actions/setup-node@v4
4747
with:
48-
node-version: 16.x
48+
node-version: 22.x
4949

5050
- name: Install dependencies
5151
if: steps.cacheNpm.outputs.cache-hit != 'true'
@@ -71,15 +71,15 @@ jobs:
7171
run: npm run integration-test-run-package
7272

7373
windowsNode16:
74-
name: '[Windows] Node.js v16: Unit tests'
74+
name: '[Windows] Node 16: Unit tests'
7575
runs-on: windows-latest
7676
steps:
7777
- name: Checkout repository
78-
uses: actions/checkout@v3
78+
uses: actions/checkout@v4
7979

8080
- name: Retrieve dependencies from cache
8181
id: cacheNpm
82-
uses: actions/cache@v3
82+
uses: actions/cache@v4
8383
with:
8484
path: |
8585
~/.npm
@@ -90,7 +90,7 @@ jobs:
9090
npm-v16-${{ runner.os }}-refs/heads/main-
9191
9292
- name: Install Node.js and npm
93-
uses: actions/setup-node@v3
93+
uses: actions/setup-node@v4
9494
with:
9595
node-version: 16.x
9696

@@ -102,29 +102,29 @@ jobs:
102102
- name: Unit tests
103103
run: npm test -- -b
104104

105-
linuxNode14:
106-
name: '[Linux] Node.js 14: Isolated unit tests'
105+
linuxNode16:
106+
name: '[Linux] Node 16: Isolated unit tests'
107107
runs-on: ubuntu-latest
108108
steps:
109109
- name: Checkout repository
110-
uses: actions/checkout@v3
110+
uses: actions/checkout@v4
111111

112112
- name: Retrieve dependencies from cache
113113
id: cacheNpm
114-
uses: actions/cache@v3
114+
uses: actions/cache@v4
115115
with:
116116
path: |
117117
~/.npm
118118
node_modules
119-
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
119+
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
120120
restore-keys: |
121-
npm-v14-${{ runner.os }}-${{ github.ref }}-
122-
npm-v14-${{ runner.os }}-refs/heads/main-
121+
npm-v16-${{ runner.os }}-${{ github.ref }}-
122+
npm-v16-${{ runner.os }}-refs/heads/main-
123123
124124
- name: Install Node.js and npm
125-
uses: actions/setup-node@v3
125+
uses: actions/setup-node@v4
126126
with:
127-
node-version: 14.x
127+
node-version: 16.x
128128

129129
- name: Install dependencies
130130
if: steps.cacheNpm.outputs.cache-hit != 'true'
@@ -135,33 +135,3 @@ jobs:
135135
# Some tests depend on TTY support, which is missing in GA runner
136136
# Workaround taken from https://github.com/actions/runner/issues/241#issuecomment-577360161
137137
run: script -e -c "npm run test:isolated -- -b"
138-
139-
linuxNode12:
140-
name: '[Linux] Node.js v12: Node version validation test'
141-
runs-on: ubuntu-latest
142-
steps:
143-
- name: Checkout repository
144-
uses: actions/checkout@v3
145-
146-
- name: Install Node.js and npm
147-
uses: actions/setup-node@v3
148-
with:
149-
node-version: 12.x
150-
151-
- name: Node version validation test
152-
run: ./bin/serverless.js 2>&1 | grep -q "does not support"
153-
154-
linuxNode4:
155-
name: '[Linux] Node.js v4: Node version validation test'
156-
runs-on: ubuntu-latest
157-
steps:
158-
- name: Checkout repository
159-
uses: actions/checkout@v3
160-
161-
- name: Install Node.js and npm
162-
uses: actions/setup-node@v3
163-
with:
164-
node-version: 4.x
165-
166-
- name: Node version validation test
167-
run: ./bin/serverless.js 2>&1 | grep -q "does not support"

0 commit comments

Comments
 (0)