Skip to content

refactor: improve FakeBuffer polyfill #45

refactor: improve FakeBuffer polyfill

refactor: improve FakeBuffer polyfill #45

Workflow file for this run

# This is a Github Workflow that runs tests on any push or pull request.
# If the tests pass and this is a push to the master branch it also runs Semantic Release.
name: CI
on: [push, pull_request]
env:
npm_config_audit: false
npm_config_fund: false
npm_config_save: false
npm_config_package_lock: false
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Use Node.js 24
uses: actions/setup-node@v5
with:
node-version: 24
cache: 'npm'
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: build
path: |
target
package.json
jsr.json
retention-days: 1
test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v5
with:
name: build
- name: Fetch deps
run: npm ci
- name: Run tests
run: npm run test
# release:
# name: Release ${{ github.ref }}
# needs: test
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
# runs-on: ubuntu-latest
# permissions:
# checks: read
# statuses: write
# contents: write
# packages: write
# id-token: write
# steps:
# - name: Checkout
# uses: actions/checkout@v5
# with:
# fetch-depth: 0
# - name: Setup Node.js
# uses: actions/setup-node@v5
# with:
# node-version: 24
# cache: 'npm'
# - uses: actions/download-artifact@v5
# with:
# name: build
# - name: Run release
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# NPM_PROVENANCE: true
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GIT_BRANCH: 'main'
# GIT_AUTHOR_NAME: ${{ vars.GIT_AUTHOR_NAME }}
# GIT_AUTHOR_EMAIL: ${{ vars.GIT_AUTHOR_EMAIL }}
# GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME }}
# GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL }}
# run: npx zx-semrel
smoke-node:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: build
name: smoke-node${{ matrix.node-version }}
strategy:
matrix:
node-version: [8, 12, 18, 24]
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/download-artifact@v5
with:
name: build
- name: Run smoke:esm tests
if: matrix.node-version >= 12
run: npm run smoke:esm
- name: Run smoke:cjs tests
run: npm run smoke:cjs
smoke-node-win32:
if: github.event_name == 'pull_request'
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Setup Node.js 24
uses: actions/setup-node@v5
with:
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v5
with:
name: build
- name: Run smoke:esm tests
run: npm run smoke:esm
- name: Run smoke:cjs tests
run: npm run smoke:cjs
smoke-browser:
if: github.event_name == 'pull_request'
timeout-minutes: 5
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v5
- name: Setup Node.js 24
uses: actions/setup-node@v5
with:
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v5
with:
name: build
- run: |
npm ci
npx playwright install --with-deps chromium
npm run smoke:browser
smoke-bun:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v5
- name: Setup Bun
uses: antongolub/action-setup-bun@v1
- uses: actions/download-artifact@v5
with:
name: build
- run: |
bun ./src/test/smoke/node.test.cjs
bun ./src/test/smoke/node.test.mjs
smoke-deno:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: smoke-deno${{ matrix.deno-version }}
needs: build
strategy:
matrix:
deno-version: [ 1, 2 ]
steps:
- uses: actions/checkout@v5
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.deno-version }}
- run: deno install npm:types/node
- uses: actions/download-artifact@v5
with:
name: build
- run: deno test ./src/test/smoke/deno.test.js --allow-read --allow-sys --allow-env --allow-run