Files
discordeno/.github/workflows/unit-test.yml
dependabot[bot] 3a4fdc1026 build(deps): bump actions/setup-node from 5 to 6 (#4539)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fleny <Fleny113@outlook.com>
2025-10-20 19:06:11 +02:00

49 lines
1.4 KiB
YAML

name: Package Test
permissions:
contents: read
on:
workflow_call:
inputs:
package:
required: true
type: string
jobs:
unit-test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 20
cache: yarn
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-test: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: Build type cache
if: steps.turbo-cache.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-build:type-${{ github.sha }}
- name: Unit Test
run: yarn test:unit --cache-dir=".turbo" --filter=./packages/${{ inputs.package }}
timeout-minutes: 1
- name: Collect and upload the coverage report
uses: codecov/codecov-action@v5
with:
files: ./packages/${{ inputs.package }}/coverage/lcov.info
flags: ${{ inputs.package }}-unit,${{ inputs.package }}
token: ${{ secrets.CODECOV_TOKEN }}