Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mostly copied from executablebooks/thebe includes npm-publish. Does not yet have a token in the secrets!
- Loading branch information
Showing
3 changed files
with
120 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 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://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | ||
|
||
name: upload-npm | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
publish-npm: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm ci | ||
- run: npm publish | ||
env: | ||
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,98 @@ | ||
# Useful GitHub Actions docs: | ||
# | ||
# - https://help.github.com/en/actions | ||
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
# - https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow | ||
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions | ||
|
||
name: test | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
# Job to run linter / autoformat | ||
|
||
lint: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
# Action Repo: https://github.com/actions/checkout | ||
- name: "Checkout repo" | ||
uses: actions/checkout@v2 | ||
|
||
# Action Repo: https://github.com/actions/setup-node | ||
- name: "Setup Node" | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "14" | ||
|
||
# Action Repo: https://github.com/actions/cache | ||
- name: "Cache node_modules" | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
- name: "Install" | ||
run: | | ||
npm ci | ||
- name: "`npm run fmt` and check for changes" | ||
run: | | ||
# If this fails, run `npm run fmt` and push the result | ||
# amend if you feel so inclined. | ||
npm run fmt | ||
git diff --exit-code | ||
- name: npm audit | ||
run: | | ||
# If this fails, run `npm audit fix` | ||
npm audit --production --audit-level=moderate | ||
test: | ||
# no need to wait for lint | ||
# needs: lint | ||
runs-on: ubuntu-20.04 | ||
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy | ||
strategy: | ||
fail-fast: false # Do not cancel all jobs if one fails | ||
matrix: | ||
node_version: | ||
- "10" | ||
- "12" | ||
- "14" | ||
- "15" | ||
|
||
steps: | ||
- name: "Checkout repo" | ||
uses: actions/checkout@v2 | ||
|
||
# Action Repo: https://github.com/actions/setup-node | ||
- name: "Setup Node" | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
# Action Repo: https://github.com/actions/cache | ||
- name: "Cache node_modules" | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
- name: "Install dependencies" | ||
run: | | ||
npm ci | ||
- name: "Run tests" | ||
run: | | ||
npm test | ||
# Action Repo: https://github.com/codecov/codecov-action | ||
- name: "Upload coverage to codecov" | ||
uses: codecov/codecov-action@v1 |
This file was deleted.
Oops, something went wrong.