Merge pull request #15 from snyk/feat/ownership #18
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 snyk-to-html' | |
on: | |
push | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [10, 12, 14, 16] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: npm config get cache | |
id: npm-cache-dir | |
run: echo "::set-output name=dir::$(npm config get cache)" | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }} | |
restore-keys: ${{ runner.os }}-node-${{ matrix.node-version }}- | |
- run: npm install | |
- run: npm run test | |
release: | |
if: github.ref == 'refs/heads/master' # only run on master | |
needs: test | |
name: Release add-to-package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: npm config get cache | |
id: npm-cache-dir | |
run: echo "::set-output name=dir::$(npm config get cache)" | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-14-${{ hashFiles('**/package.json') }} | |
restore-keys: ${{ runner.os }}-node-14- | |
- run: npm install | |
- run: npm run release | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} |