Update lock #14
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: Test and release | |
# Run the workflow when a Pull Request is opened or when changes are pushed to main | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Run the steps below with the following versions of Node.js | |
node-version: [16.x] | |
steps: | |
# Fetch the latest commit | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Setup Node.js using the appropriate version | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# Install package dependencies | |
- name: Install | |
run: npm ci | |
# Run tests | |
- name: Test | |
run: npm test | |
release: | |
# Only release on push to main | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
# Waits for test jobs for each Node.js version to complete | |
needs: [test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.13 | |
- name: Install | |
run: npm ci | |
- name: Release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |