Use NX for monorepo setup #34
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "CI: test & build" | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| push: | |
| branches: | |
| - master | |
| - dev | |
| - dev-v6 | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # "node_js: - stable" logic (Node 24 is current LTS/stable) | |
| node-version: [24.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "yarn" # Automatic caching for Yarn | |
| - name: Install dependencies | |
| # --frozen-lockfile ensures yarn.lock is respected exactly | |
| run: yarn install --frozen-lockfile | |
| - name: Run lint | |
| # This runs lint with eslint | |
| run: yarn lint | |
| - name: Run tests and generate coverage | |
| # This runs vitest with coverage enabled | |
| run: yarn test:coverage | |
| - name: Debug coverage file | |
| run: | | |
| echo "Repo pwd: $(pwd)" | |
| echo "coverage file exists:" && [ -f coverage/lcov.info ] && ls -l coverage/lcov.info || echo "no coverage/lcov.info" | |
| echo "size:" && wc -c coverage/lcov.info || true | |
| echo "preview:" && head -n 60 coverage/lcov.info || true | |
| - name: Sanitize LCOV | |
| run: | | |
| if [ -f coverage/lcov.info ]; then | |
| # Remove stray lines that are exactly 'SF' (no filename) which break some parsers | |
| grep -v '^SF$' coverage/lcov.info > coverage/lcov.info.tmp || true | |
| mv coverage/lcov.info.tmp coverage/lcov.info || true | |
| echo "Sanitized LCOV size:" && wc -c coverage/lcov.info || true | |
| else | |
| echo "No coverage/lcov.info found to sanitize" | |
| fi | |
| # - name: Upload coverage reports to Codecov | |
| # uses: codecov/codecov-action@v5 | |
| # with: | |
| # token: ${{ secrets.CODECOV_TOKEN }} | |
| # files: "./coverage" | |
| - name: Upload coverage to Coveralls | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| format: lcov | |
| file: "coverage/lcov.info" | |
| # - name: Upload to Coveralls | |
| # run: yarn coveralls | |
| # env: | |
| # # REQUIRED: The script needs this to know where to upload | |
| # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
| - name: Build the library | |
| run: yarn build |