use node-version 18 in Actions #27
Workflow file for this run
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
name: Continuous Integration | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: | |
- master | |
jobs: | |
report: | |
name: Report | |
runs-on: ubuntu-latest | |
steps: | |
- name: ref | |
run: echo ${{ github.ref }} | |
- name: event_name | |
run: echo ${{ github.event_name }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v1 | |
- name: setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18' | |
- name: install | |
run: npm install | |
- name: build | |
run: npm run build | |
- name: coverage | |
run: npm run coverage | |
- name: Upload coverage to Codecov | |
if: github.event_name == 'push' && endsWith(github.ref,'/master') | |
uses: codecov/[email protected] | |
# should not need token as it is a public repo | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
# apparently, there is no way to condition the entire job, do we have to condition each | |
# and I also cannot make a workflow conditional, so I cannot make publish a separate workflow | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: checkout | |
if: github.event_name == 'create' && startsWith(github.ref,'refs/tags/') | |
uses: actions/checkout@v1 | |
- name: setup node | |
if: github.event_name == 'create' && startsWith(github.ref,'refs/tags/') | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
- name: install | |
run: npm install | |
- name: deploy | |
if: github.event_name == 'create' && startsWith(github.ref,'refs/tags/') | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |