Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/_jest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Jest Testing (Reusable)

# This workflow can be called from other repositories
# Usage:
# jobs:
# call-jest:
# uses: ubiquity-os/plugin-template/.github/workflows/_jest.yml@v1.0.0

on:
workflow_call:
inputs:
bun-version:
description: 'Bun version to use'
required: false
default: 'latest'
type: string

env:
NODE_ENV: "test"

jobs:
testing:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ inputs.bun-version || 'latest' }}

- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Jest With Coverage
run: |
bun install --frozen-lockfile
bun run test

- name: Add Jest Report to Summary
if: always()
run: echo "$(cat test-dashboard.md)" >> $GITHUB_STEP_SUMMARY
46 changes: 46 additions & 0 deletions .github/workflows/_knip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Knip (Reusable)

# This workflow can be called from other repositories
# Usage:
# jobs:
# call-knip:
# uses: ubiquity-os/plugin-template/.github/workflows/_knip.yml@v1.0.0

on:
workflow_call:
inputs:
bun-version:
description: 'Bun version to use'
required: false
default: 'latest'
type: string

jobs:
run-knip:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ inputs.bun-version || 'latest' }}

- name: Install toolchain
run: bun install

- name: Store PR number
run: echo ${{ github.event.number || '0' }} > pr-number.txt

- name: Run Knip
run: bun run knip || bun run knip --reporter json > knip-results.json

- name: Upload knip result
if: failure()
uses: actions/upload-artifact@v4
with:
name: knip-results
path: |
knip-results.json
pr-number.txt
27 changes: 4 additions & 23 deletions .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,8 @@ on:
workflow_dispatch:
pull_request:

env:
NODE_ENV: "test"

jobs:
testing:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Jest With Coverage
run: |
bun install --frozen-lockfile
bun run test

- name: Add Jest Report to Summary
if: always()
run: echo "$(cat test-dashboard.md)" >> $GITHUB_STEP_SUMMARY
call-jest:
uses: ubiquity-os/plugin-template/.github/workflows/_jest.yml@v1.0.0
with:
bun-version: latest
30 changes: 4 additions & 26 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,7 @@ on:
workflow_dispatch:

jobs:
run-knip:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install toolchain
run: bun install

- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt

- name: Run Knip
run: bun run knip || bun run knip --reporter json > knip-results.json

- name: Upload knip result
if: failure()
uses: actions/upload-artifact@v4
with:
name: knip-results
path: |
knip-results.json
pr-number.txt
call-knip:
uses: ubiquity-os/plugin-template/.github/workflows/_knip.yml@v1.0.0
with:
bun-version: latest
Loading