-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): 🚀 Migrate CI and Deployment to Github actions
- Loading branch information
Showing
4 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
|
||
name: NPM-CI | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
node-version: [14.x, 16.x, 18.x, 20.x] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm ci | ||
- run: npm test -- --reporter json --reporter-option output=test-results.json | ||
- name: Archive test results | ||
uses: actions/upload-artifact@v3 | ||
if: success() || failure() | ||
with: | ||
name: test-results-report | ||
path: test-results.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: NPM-Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: {} | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
publish-npm: | ||
# if: ${{github.GITHUB_REF == 'refs/heads/master'}} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
# See below for current versions supported by Node-red | ||
# https://nodered.org/docs/faq/node-versions#installing-nodejs | ||
node-version: 18 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm ci | ||
- run: npm test | ||
- run: npx semantic-release | ||
env: | ||
# NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Test Report' | ||
on: | ||
workflow_run: | ||
workflows: ['NPM-CI'] # runs after CI workflow | ||
types: | ||
- completed | ||
jobs: | ||
report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dorny/test-reporter@v1 | ||
with: | ||
artifact: test-results-report # artifact name | ||
name: Mocha Tests # Name of the check run which will be created | ||
path: '*.json' # Path to test results (inside artifact .zip) | ||
reporter: mocha-json # Format of test results |