Skip to content

Update Node support to match versions currently supported by AWS #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
79 changes: 67 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,80 @@
name: build

# We want pushes to main, beta, and alpha to trigger a publish to npm for the corresponding npm dist-tag.
# Any pull request targeting deploy branches should run all tests.

on:
push:
branches: [main, beta, alpha]

pull_request:
branches: [main, beta, alpha]

# Allow one concurrent build for the same branch
concurrency:
group: current-branch-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
uses: activescott/github-actions-workflows/.github/workflows/npm-tester.yml@npm-tester-v4
with:
package_dir: ./
node_versions: "[14, 16, 18]"
do_coveralls: true
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "npm"

publish:
- name: install dependencies
run: |
npm i

- name: test
env:
CI_NODE_VERSION: ${{ matrix.node }}
run: |
npm run test

- name: publish coverage
uses: coverallsapp/github-action@master
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: nodejs-${{ matrix.node }}
parallel: true

update_code_coverage:
needs: test
runs-on: ntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

publish_package:
if: ${{ github.event_name != 'pull_request' }}
needs: [test]
uses: activescott/github-actions-workflows/.github/workflows/[email protected]
with:
package_dir: ./
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
needs: test
runs-on: ubuntu-latest
environment: npm
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: publish to npm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm install
2 changes: 1 addition & 1 deletion examples/basic/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ service: basic-example

provider:
name: aws
runtime: nodejs14.x
runtime: nodejs20.x
region: us-west-2

functions:
Expand Down
2 changes: 1 addition & 1 deletion examples/comprehensive/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ service: basic-example # NOTE: update this with your service name

provider:
name: aws
runtime: nodejs14.x
runtime: nodejs20.x
region: us-west-2

environment:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"tdd"
],
"engines": {
"node": ">=14"
"node": ">=20"
},
"repository": {
"type": "git",
Expand Down
Loading