npm-dependency-vulnerabilities test #34
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: npm-dependency-vulnerabilities test | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
paths: | |
- npm-dependency-vulnerabilities | |
workflow_dispatch: | |
jobs: | |
units: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set Node.js 16 | |
uses: actions/[email protected] | |
with: | |
node-version: 16 | |
- name: Run tests | |
working-directory: ./actions/npm-dependency-vulnerabilities | |
run: | | |
npm ci | |
npm run test | |
check-dist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set Node.js 16 | |
uses: actions/[email protected] | |
with: | |
node-version: 16 | |
- name: Install dependencies and build | |
working-directory: ./actions/npm-dependency-vulnerabilities | |
run: | | |
npm ci | |
npm run prepare | |
- name: Compare the expected and actual dist/ directories | |
working-directory: ./actions/npm-dependency-vulnerabilities | |
run: | | |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then | |
echo "Detected uncommitted changes after build. See status below:" | |
git diff | |
exit 1 | |
fi | |
id: diff | |
# If index.js was different from expected, upload the expected version as an artifact | |
- uses: actions/upload-artifact@v2 | |
if: ${{ failure() && steps.diff.conclusion == 'failure' }} | |
with: | |
name: dist | |
path: actions/npm-dependency-vulnerabilities/dist/ | |
# test action works running from the graph | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./actions/npm-dependency-vulnerabilities |