test(octree): Add unit tests for Octree, OctreeNode, and OctreeRegionUtils #58
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: typescript | |
| on: | |
| pull_request: | |
| paths: | |
| - 'tools/**/*.ts' | |
| - 'tools/**/*.tsx' | |
| - 'tools/**/*.js' | |
| - 'tools/**/*.jsx' | |
| - 'tools/**/*.cjs' | |
| - 'tools/**/*.mjs' | |
| - 'tools/**/package.json' | |
| - 'tools/**/tsconfig*.json' | |
| - 'tools/**/vitest.config.*' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - 'pnpm-workspace.yaml' | |
| - '.prettierrc' | |
| - '.github/workflows/typescript.yml' | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| cache: true | |
| - name: Setup npm for GitHub Packages | |
| run: | | |
| if [ -n "$GITHUB_TOKEN" ]; then | |
| echo -e "\n//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc | |
| echo -e "\n//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ~/.npmrc | |
| fi | |
| if [ -n "$NPM_TOKEN" ]; then | |
| echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc | |
| echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check (lint:ts) | |
| run: npm run lint:ts | |
| - name: Prettier check (lint:prettier) | |
| run: npm run lint:prettier | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| cache: true | |
| - name: Setup npm for GitHub Packages | |
| run: | | |
| if [ -n "$GITHUB_TOKEN" ]; then | |
| echo -e "\n//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc | |
| echo -e "\n//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ~/.npmrc | |
| fi | |
| if [ -n "$NPM_TOKEN" ]; then | |
| echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc | |
| echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build all tools | |
| run: pnpm -r --filter './tools/**' --filter '!./tools/nevermore-vscode' run build | |
| - name: Run TypeScript tests (test:ts) | |
| run: npm run test:ts |