Skip to content

Add an example to run vitest tests #1

Add an example to run vitest tests

Add an example to run vitest tests #1

name: vitest-example-test-suite
on: [push]
jobs:
vitest-example-test-suite:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ci_node_index: [0, 1, 2, 3]
name: vitest-example-test-suite (${{ matrix.ci_node_index }})
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Build
working-directory: packages/vitest
run: |
npm run build
npm link
- name: Link @knapsack-pro/vitest to vitest-example-test-suite
working-directory: packages/vitest-example-test-suite
run: npm link @knapsack-pro/vitest
- name: Run tests
working-directory: packages/vitest-example-test-suite
env:
KNAPSACK_PRO_TEST_SUITE_TOKEN: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN }}
KNAPSACK_PRO_CI_NODE_TOTAL: 4
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
KNAPSACK_PRO_LOG_LEVEL: "error"
run: npm exec @knapsack-pro/vitest