Files
discordeno/.github/workflows/other-runtime-unit-test.yml
Fleny b0c1b9f795 ci: Use mocha for both deno and bun (#4067)
* Use mocha for both deno and bun

* Use any Bun 1.1

* remove build:type dependency in lib-check.yml

* Pin point 1.1.42

* remove packages/bot/.mocharc.json
2025-01-01 09:59:06 -08:00

82 lines
2.6 KiB
YAML

name: Other Runtime Package Test
on:
workflow_call:
inputs:
package:
required: true
type: string
jobs:
deno-unit-test:
name: Deno Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: denoland/setup-deno@v2
with:
deno-version: 'v2.1.x'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-test:deno-unit-${{ inputs.package }}-${{ github.sha }}
- name: Build dist cache
if: steps.turbo-cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-build-${{ github.sha }}
- name: Deno Unit Test
run: yarn test:deno-unit --cache-dir=".turbo" --filter=./packages/${{ inputs.package }}
bun-unit-test:
name: Bun Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.1.42'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-test:bun-unit-${{ inputs.package }}-${{ github.sha }}
- name: Build dist cache
if: steps.turbo-cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-build-${{ github.sha }}
- name: Bun Unit Test
run: yarn test:bun-unit --cache-dir=".turbo" --filter=./packages/${{ inputs.package }}
timeout-minutes: 1