Skip to content

bun.sh compatibility & bun CI #2483

bun.sh compatibility & bun CI

bun.sh compatibility & bun CI #2483

Workflow file for this run

name: Test
on:
push:
branches:
- master
tags:
pull_request:
jobs:
test-node:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
corepack enable && pnpm install
- name: Build
run: |
pnpm --filter megalodon run build
- name: Testing
run: |
pnpm --filter megalodon run test
test-bun:
runs-on: ubuntu-latest
strategy:
matrix:
bun-version: ['latest']
steps:
- uses: actions/checkout@v2
- uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun-version }}
- name: Install dependencies
run: |
bun install
- name: Build (Bun)
run: cd megalodon && bun run build:bun-node && bun run build:bun
- name: Testing (Bun)
run: cd megalodon && bun run test
- name: Browser example (Bun)
run: cd example/browser && bun run build:bun-node && bun run build:bun
- name: Typescript example (Bun)
run: |
cd megalodon && bun run test
pnpm -r run build
example:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
corepack enable && pnpm install
- name: Build library
run: |
pnpm --filter megalodon run build
- name: Build examples
run: |
pnpm --filter !megalodon run build
- name: Typescript example
env:
MASTODON_URL: https://fedibird.com
PLEROMA_URL: https://pleroma.io
FIREFISH_URL: https://fedi.software
FRIENDICA_URL: https://squeet.me
run: |
pnpm --filter example run build
node example/typescript/dist/mastodon/instance.js
node example/typescript/dist/pleroma/instance.js
node example/typescript/dist/firefish/instance.js
node example/typescript/dist/friendica/instance.js
example-bun:
runs-on: ubuntu-latest
strategy:
matrix:
bun-version: ['latest']
steps:
- uses: actions/checkout@v2
- uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun-version }}
- name: Install dependencies
run: |
bun install
- name: Build (Bun)
run: cd megalodon && bun run build:bun-node && bun run build:bun
- name: Testing (Bun)
run: cd megalodon && bun run test
- name: Typescript example (Bun)
run: cd example/typescript && bun run build:bun
(env URL=https://fedibird.com bun run dist/detector.js | grep -q 'mastodon' && exit 0 || exit 1)
(env URL=https://pleroma.io bun run dist/detector.js | grep -q 'pleroma' && exit 0 || exit 1)
(env URL=https://fedi.software bun run dist/detector.js | grep -q 'firefish' && exit 0 || exit 1)
(env URL=https://squeet.me bun run dist/detector.js | grep -q 'friendica' && exit 0 || exit 1)