-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: CI: Add smoke test for npm-published package
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: npm smoke test | ||
|
||
on: | ||
- release | ||
permissions: {} | ||
|
||
jobs: | ||
release-smoke-test: | ||
name: ${{ github.ref }} ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: linux-x64-node-deno-bun | ||
os: ubuntu-22.04 | ||
- name: darwin-x64-node-deno-bun | ||
os: macos-11 | ||
- name: win32-x64-node-deno | ||
os: windows-2019 | ||
steps: | ||
- name: Create package.json | ||
uses: DamianReeves/write-file-action@v1 | ||
with: | ||
path: package.json | ||
contents: | | ||
{ | ||
"dependencies": { | ||
"sharp": "${{ github.ref }}" | ||
} | ||
} | ||
- name: Create release.mjs | ||
uses: DamianReeves/write-file-action@v1 | ||
with: | ||
path: release.mjs | ||
contents: | | ||
import { createRequire } from 'node:module'; | ||
import { deepStrictEqual } from 'node:assert'; | ||
const require = createRequire(import.meta.url); | ||
const sharp = require('sharp'); | ||
deepStrictEqual(['.jpg', '.jpeg', '.jpe'], sharp.format.jpeg.input.fileSuffix); | ||
- name: Install Node.js | ||
if: ${{ contains(matrix.name, 'node') }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- name: Run with Node.js | ||
if: ${{ contains(matrix.name, 'node') }} | ||
run: | | ||
npm install | ||
node release.mjs | ||
- name: Install Deno | ||
if: ${{ contains(matrix.name, 'deno') }} | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
- name: Run with Deno | ||
if: ${{ contains(matrix.name, 'deno') }} | ||
run: deno run --allow-read --allow-ffi release.mjs | ||
|
||
- name: Install Bun | ||
if: ${{ contains(matrix.name, 'bun') }} | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
- name: Run with Bun | ||
if: ${{ contains(matrix.name, 'bun') }} | ||
run: | | ||
bun install | ||
bun release.mjs |