Skip to content

Commit

Permalink
fix: update node engines to 18+, CI to test 18, 20, update eslint-con…
Browse files Browse the repository at this point in the history
…fig (#18)

* ignore node/shebang linting rule, remove prettier (eslint conflict)
  • Loading branch information
shazron authored Jan 10, 2024
1 parent 6969f7e commit a0a5f0d
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 14,604 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"@jest/globals"
]
}
]
],
"node/shebang": [0, {"convertPath": null}]
},
"parserOptions": {
"ecmaVersion": 2020
Expand Down
39 changes: 31 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
name: CI
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

on: push
name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18.x, 20.x]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm i
- name: Run tests
run: npm test
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i --package-lock --package-lock-only
- run: npm ci
- run: npm run build --if-present
- run: npm test
- name: upload coverage
if: success()
uses: codecov/codecov-action@v3.1.1
with:
name: ${{ runner.os }} node.js ${{ matrix.node-version }}
2 changes: 1 addition & 1 deletion .github/workflows/on-release-creation-publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# See https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
- uses: actions/setup-node@v2
with:
node-version: "14.x"
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm test
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: publish-prerelease
on:
workflow_dispatch:
inputs:
pre-release-tag:
description: 'The pre-release tag use in the version'
required: false
default: 'pre'
dist-tag:
description: 'The dist-tag use'
required: false
default: 'next'
dependencies-to-update:
description: 'csv of dependencies to update with the dist-tag'
required: false
default: '@adobe/aio-lib-console-project-installation'
jobs:
checkout:
name: checkout
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
- uses: actions/setup-node@v1
with:
node-version: 18
- run: |
npm install
npm test
- name: Update your package.json with an npm pre-release version
id: pre-release-version
uses: adobe/update-prerelease-npm-version@v1.1.0
with:
pre-release-tag: ${{ github.event.inputs.pre-release-tag }}
dependencies-to-update: ${{ github.event.inputs.dependencies-to-update }}
dependencies-to-update-version-tag: ${{ github.event.inputs.dist-tag }}
- run: echo pre-release-version - ${{ steps.pre-release-version.outputs.pre-release-version }}
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
tag: ${{ github.event.inputs.dist-tag }}
access: 'public'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ junit.xml

# OSX
.DS_Store

package-lock.json
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package-lock=false
tag-version-prefix=""
preid="next"
Loading

0 comments on commit a0a5f0d

Please sign in to comment.