Skip to content

ci: test glob

ci: test glob #79

Workflow file for this run

name: Unit Tests
on:
workflow_call:
push:
branches: [main]
pull_request:
types: [
synchronize, # PR was updated
opened, # PR was open
reopened, # PR was closed and is now open again
ready_for_review, # PR was converted from draft to open
]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Run Unit Tests
run: pnpm coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
if: github.event_name != 'workflow_call'
- name: Run Mutation Tests and Publish to Dashboard
if: github.event_name != 'workflow_call' && github.event_name != 'pull_request'
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: pnpm test:mutation
- name: Run Unit Test Against Package
# pnpm has a bug with pack script /~https://github.com/pnpm/pnpm/issues/4351
run: |
cd packages/gerador-validador-cpf
pnpm pack
tar zxvf *.tgz
cd ../../
pnpm test:package