Skip to content

Update NPM dependencies 2024-11 #272

Update NPM dependencies 2024-11

Update NPM dependencies 2024-11 #272

Workflow file for this run

on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- run: npm ci
- run: npm test
- run: npx gulp
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rm -rf dist
name: remove dist folder before running linter
- uses: github/super-linter@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_GITHUB_ACTIONS: 'false' # due to not recognizing of core.setOutput
check-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v3
id: pr-files
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
if (!context.payload.pull_request) {
console.log('Not pull request')
return
}
const files = await github.paginate(github.pulls.listFiles, { owner: context.repo.owner, repo: context.repo.repo, pull_number: context.payload.pull_request.number})
if (!files.find(i => i.filename === 'man/swatcher.md')) return
console.log('found and setting output')
core.setOutput('is-documentation-updated', 1)
- run: sudo gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" && bundle install
- run: bundle exec ronn -r man/swatcher.md
if: ${{ steps.pr-files.outputs.is-documentation-updated == true }}
- run: npm ci
- run: npx gulp
- name: check if freshly built dist folder differs from commited one
run: git status --porcelain | tee /dev/stderr | ( ! grep -q '.' )
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: e2e/collect_and_generate.sh
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci
- name: check if version is synced and valid
run: |
npm install @babel/core @babel/node semver
cat <<EOF > check_version.js
const assert = require('assert').strict;
const version = require('./version.js').default;
const packageVersion = require('./package.json').version;
const semver = require('semver');
assert.equal(version, packageVersion, 'package.json version should equal to embedded version.js file. This is done to populate help method of executable');
assert.ok(semver.valid(version))
EOF
npx babel-node check_version.js
- uses: del-systems/check-if-version-bumped@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
demo:
runs-on: ubuntu-latest
needs: [check-files, check-version, test]
steps:
- uses: actions/checkout@v2
- run: docker run --entrypoint sh -v "$(realpath .):/data" buildkite/puppeteer:latest /data/demo/render_using_catage.sh
- run: npm ci && dist/index.mjs collect . && dist/index.mjs generate-diff
env:
SWATCHER_S3_SECRET_KEY: ${{ secrets.SWATCHER_S3_SECRET_KEY }}
SWATCHER_S3_REGION: ${{ secrets.SWATCHER_S3_REGION }}
SWATCHER_S3_BUCKET_NAME: ${{ secrets.SWATCHER_S3_BUCKET_NAME }}
SWATCHER_S3_ACCESS_KEY: ${{ secrets.SWATCHER_S3_ACCESS_KEY }}
SWATCHER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
runs-on: ubuntu-latest
needs: [test, demo]
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v2
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com/