Skip to content

Refactor Hermes detection and improve safety checks #210

Refactor Hermes detection and improve safety checks

Refactor Hermes detection and improve safety checks #210

Workflow file for this run

name: ci
on:
pull_request:
branches:
- master
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependency
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun install --frozen-lockfile
- name: Run lint and typecheck
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run lint
test:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependency
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun install --frozen-lockfile
- name: Run unit tests with coverage
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run test:coverage
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage
if-no-files-found: error
node18-smoke:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- name: Install Dependency
run: bun install --frozen-lockfile
- name: Build package
run: bun run build
# Node 18 goes on PATH only after the build: typescript >= 7 ships an
# extensionless ESM bin/tsc that Node 18.17 cannot load.
- name: Set up the oldest supported Node.js
uses: actions/setup-node@v7
with:
node-version: '18.17.0'
- name: Load every built module and run the offline commands
run: node scripts/smoke-lib.js
publish-dry-run:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v7
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependency
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun install --frozen-lockfile
- name: Prepare dry run publish version
env:
PUBLISH_DRY_RUN: 'true'
PUBLISH_VERSION: 0.0.0-dry-run.${{ github.run_id }}.${{ github.run_attempt }}
run: bun scripts/prepublish.ts
- name: Dry run publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --dry-run --access public --tag dry-run