Fix pre-existing clippy errors so cargo clippy --all-targets passes (#21)
#90
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 | |
| on: | |
| push: | |
| branches: [main] | |
| tags-ignore: ['**'] | |
| pull_request: | |
| jobs: | |
| cargo-test: | |
| name: Cargo test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-test-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: cargo-test- | |
| - name: Run cargo test | |
| run: cargo test | |
| lint: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: lint-cargo-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: lint-cargo- | |
| - name: cargo clippy | |
| run: cargo clippy --all-targets | |
| build-linux: | |
| name: Build – ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian | |
| artifact: symphony.linux-x64-gnu.node | |
| - target: x86_64-unknown-linux-musl | |
| image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine | |
| artifact: symphony.linux-x64-musl.node | |
| - target: aarch64-unknown-linux-gnu | |
| image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 | |
| artifact: symphony.linux-arm64-gnu.node | |
| - target: aarch64-unknown-linux-musl | |
| image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine | |
| artifact: symphony.linux-arm64-musl.node | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ matrix.target }}-cargo-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: ${{ matrix.target }}-cargo- | |
| - name: Build (${{ matrix.target }}) | |
| uses: addnab/docker-run-action@v3 | |
| with: | |
| image: ${{ matrix.image }} | |
| options: >- | |
| -v ${{ github.workspace }}:/build | |
| -v ${{ env.HOME }}/.cargo/registry:/usr/local/cargo/registry | |
| -v ${{ env.HOME }}/.cargo/git:/usr/local/cargo/git | |
| -w /build | |
| run: | | |
| set -e | |
| rustup update stable | |
| rustup target add ${{ matrix.target }} | |
| npm ci --ignore-scripts | |
| if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then | |
| export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc | |
| export CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc | |
| fi | |
| npm run build -- --target ${{ matrix.target }} | |
| strip --strip-unneeded ${{ matrix.artifact }} 2>/dev/null || true | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: ${{ matrix.artifact }} | |
| if-no-files-found: error | |
| build-macos: | |
| name: Build – macOS (arm64 + x64) | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Install Rust targets | |
| run: | | |
| rustup target add aarch64-apple-darwin | |
| rustup target add x86_64-apple-darwin | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: macos-cargo-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: macos-cargo- | |
| - name: Install dependencies | |
| run: npm install --ignore-scripts | |
| - name: Build aarch64-apple-darwin | |
| run: npm run build -- --target aarch64-apple-darwin | |
| - name: Build x86_64-apple-darwin | |
| run: npm run build -- --target x86_64-apple-darwin | |
| - name: Upload aarch64 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: symphony.darwin-arm64.node | |
| path: symphony.darwin-arm64.node | |
| if-no-files-found: error | |
| - name: Upload x64 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: symphony.darwin-x64.node | |
| path: symphony.darwin-x64.node | |
| if-no-files-found: error | |
| test: | |
| name: Test – ${{ matrix.os }} Node ${{ matrix.node }} | |
| runs-on: ${{ matrix.os }} | |
| needs: [build-linux, build-macos] | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| artifact: symphony.linux-x64-gnu.node | |
| node: '20' | |
| - os: ubuntu-latest | |
| artifact: symphony.linux-x64-gnu.node | |
| node: '22' | |
| - os: macos-14 | |
| artifact: symphony.darwin-arm64.node | |
| node: '20' | |
| # macos-13 (Intel) hosted runners are retired — jobs sit queued until the | |
| # 24h limit then auto-cancel. The x64-darwin artifact is still built by | |
| # build-macos; drop the x64 test leg until an Intel runner is available. | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| integration-test: | |
| name: Integration Test – Harper UDS proxy | |
| runs-on: ubuntu-latest | |
| needs: [build-linux] | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: symphony.linux-x64-gnu.node | |
| - name: Install dependencies | |
| run: npm install --ignore-scripts | |
| - name: Checkout harper-pro | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ github.repository_owner }}/harper-pro | |
| path: harper-pro | |
| token: ${{ secrets.HARPER_PRO_TOKEN || github.token }} | |
| submodules: recursive | |
| - name: Build harper | |
| # harper-pro's main branch carries pre-existing type errors, so tsc exits | |
| # non-zero even with the core submodule present; it still emits, so tolerate | |
| # the failure and gate on the built artifact (mirrors harper-pro's own CI). | |
| run: | | |
| npm ci | |
| npm run build || true | |
| test -f dist/bin/harper.js || { echo "dist/bin/harper.js missing — build failed"; exit 1; } | |
| working-directory: harper-pro | |
| - name: Run integration tests | |
| run: npm run test:integration | |
| env: | |
| HARPER_INTEGRATION_TEST_INSTALL_SCRIPT: ${{ github.workspace }}/harper-pro/dist/bin/harper.js |