perf: replace fuzzy-matcher with nucleo-matcher for improved performance #79
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: Run Tests and Build | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| jobs: | |
| pylight-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ./pylight/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Check formatting | |
| working-directory: ./pylight | |
| run: cargo fmt -- --check | |
| - name: Run clippy | |
| working-directory: ./pylight | |
| run: cargo clippy -- -D warnings | |
| - name: Run tests | |
| working-directory: ./pylight | |
| run: cargo test | |
| - name: Build release binary | |
| working-directory: ./pylight | |
| run: cargo build --release --bin pylight | |
| pydance-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: pydance/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./pydance | |
| run: npm ci | |
| - name: Run linter | |
| working-directory: ./pydance | |
| run: npm run lint | |
| - name: Check formatting | |
| working-directory: ./pydance | |
| run: npm run format:check | |
| - name: Compile TypeScript | |
| working-directory: ./pydance | |
| run: npm run compile | |
| - name: Setup Rust for pylight binary | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ./pylight/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build pylight binary | |
| working-directory: ./pylight | |
| run: cargo build --release --bin pylight | |
| - name: Copy pylight binary to pydance | |
| run: cp ./pylight/target/release/pylight ./pydance/pylight | |
| - name: Run unit tests (Linux) | |
| if: runner.os == 'Linux' | |
| working-directory: ./pydance | |
| run: xvfb-run -a npm test | |
| - name: Run unit tests (macOS/Windows) | |
| if: runner.os != 'Linux' | |
| working-directory: ./pydance | |
| run: npm test | |
| - name: Run integration tests (Linux) | |
| if: runner.os == 'Linux' | |
| working-directory: ./pydance | |
| run: xvfb-run -a npm run test:integration | |
| - name: Run integration tests (macOS/Windows) | |
| if: runner.os != 'Linux' | |
| working-directory: ./pydance | |
| run: npm run test:integration | |
| build-vsix: | |
| needs: [pylight-test, pydance-test] | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| platform: linux-x64 | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| platform: darwin-arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: pydance/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./pydance | |
| run: npm ci | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ./pylight/target | |
| key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build pylight binary | |
| working-directory: ./pylight | |
| run: | | |
| # Build for the target platform | |
| cargo build --release --target ${{ matrix.target }} --bin pylight | |
| - name: Copy pylight binary to pydance | |
| run: | | |
| # Copy the platform-specific binary | |
| cp ./pylight/target/${{ matrix.target }}/release/pylight ./pydance/pylight | |
| # Make it executable | |
| chmod +x ./pydance/pylight | |
| - name: Compile TypeScript | |
| working-directory: ./pydance | |
| run: npm run compile | |
| - name: Install vsce | |
| run: npm install -g @vscode/vsce | |
| - name: Package VSIX | |
| working-directory: ./pydance | |
| run: | | |
| # Package with dependencies included | |
| vsce package | |
| - name: Test VSIX installation | |
| working-directory: ./pydance | |
| run: | | |
| # Find the created VSIX file | |
| VSIX_FILE=$(ls *.vsix | head -n 1) | |
| echo "Testing VSIX: $VSIX_FILE" | |
| # Install VS Code CLI if not on macOS (macOS has it pre-installed) | |
| if [[ "${{ runner.os }}" == "Linux" ]]; then | |
| wget -q "https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64" -O vscode-cli.tar.gz | |
| tar -xzf vscode-cli.tar.gz | |
| chmod +x code | |
| export PATH=$PWD:$PATH | |
| fi | |
| # Try to install the extension (won't activate without a workspace, but will verify package integrity) | |
| code --install-extension "$VSIX_FILE" --force || echo "Installation test completed" | |
| - name: Upload VSIX artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pydance-vsix-${{ matrix.platform }} | |
| path: ./pydance/*.vsix | |
| retention-days: 30 |