No sandboxed puppeteer launch (#131) #277
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: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x, 22.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use NodeJS v${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install | |
run: npm ci --ignore-scripts --no-audit --no-fund | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: | | |
npx puppeteer browsers install chrome | |
npm test | |
- name: Coverage | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./tests/coverage/lcov.info | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use NodeJS v22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- name: Install | |
run: npm ci --ignore-scripts --no-audit --no-fund | |
- name: Lint | |
run: npm run lint | |
npm: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- test | |
- lint | |
name: NPM Package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use NodeJS v22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- name: Install dependencies | |
run: | | |
npm ci --ignore-scripts --no-audit --no-fund | |
npx puppeteer browsers install chrome | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm test | |
- name: Deploy to NPM | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
release: | |
name: Release | |
needs: npm | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get tag metadata | |
id: tag | |
run: | | |
TAG_TITLE=${GITHUB_REF#refs/*/} | |
echo "title=$TAG_TITLE" >> $GITHUB_OUTPUT | |
git -c protocol.version=2 fetch --prune --progress \ | |
--no-recurse-submodules origin \ | |
+refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* | |
TAG_BODY="$(git tag -l --format='%(contents)' $TAG_TITLE)" | |
TAG_BODY="${TAG_BODY//'%'/'%25'}" | |
TAG_BODY="${TAG_BODY//$'\n'/'%0A'}" | |
TAG_BODY="${TAG_BODY//$'\r'/'%0D'}" | |
echo "body=$TAG_BODY" >> $GITHUB_OUTPUT | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.tag.outputs.title }} | |
name: ${{ steps.tag.outputs.title }} | |
body: ${{ steps.tag.outputs.body }} | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |