fix: release native peer on close #17
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: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| name: Quality | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run check | |
| - run: npm run types:check | |
| - run: npm run pack:check | |
| build-test: | |
| name: ${{ matrix.os }} / Node ${{ matrix.node }} | |
| runs-on: ${{ matrix.os }} | |
| needs: quality | |
| timeout-minutes: 90 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| node: [20, 22, 24] | |
| env: | |
| WPT_TEST_TIMEOUT_MS: 180000 | |
| WPT_WORKER_TIMEOUT_MS: 600000 | |
| WPT_WORKER_DELAY_MS: 2000 | |
| WPT_CLEANUP_DELAY_MS: 3000 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: npm | |
| - name: Install Linux build dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| for attempt in 1 2 3; do | |
| if sudo apt-get update && sudo apt-get install -y cmake ninja-build libssl-dev; then | |
| exit 0 | |
| fi | |
| sleep $((attempt * 10)) | |
| done | |
| exit 1 | |
| - name: Install macOS build dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install openssl@3 | |
| echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" | |
| - name: Install Windows build dependencies | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $opensslVersion = "3.6.2" | |
| choco install openssl --version $opensslVersion --no-progress -y | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "Chocolatey failed to install OpenSSL $opensslVersion" | |
| } | |
| $roots = @( | |
| "C:\Program Files\OpenSSL", | |
| "C:\Program Files\OpenSSL-Win64", | |
| "C:\Program Files\OpenSSL-Win32" | |
| ) | |
| $opensslRoot = $roots | Where-Object { | |
| Test-Path (Join-Path $_ "include\openssl\ssl.h") | |
| } | Select-Object -First 1 | |
| if (-not $opensslRoot) { | |
| Get-ChildItem "C:\Program Files" -Directory -Filter "OpenSSL*" | Select-Object FullName | |
| throw "OpenSSL root was not found" | |
| } | |
| "OPENSSL_ROOT_DIR=$opensslRoot" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| "OPENSSL_INCLUDE_DIR=$opensslRoot\include" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| $binDir = Join-Path $opensslRoot "bin" | |
| if (Test-Path $binDir) { | |
| $binDir | Out-File -FilePath $env:GITHUB_PATH -Append | |
| & (Join-Path $binDir "openssl.exe") version | |
| } | |
| - run: npm ci | |
| - run: npm run native:check | |
| - run: npm run build | |
| - run: npm test | |
| - run: npm run api:check | |
| - run: npm run types:check | |
| - run: npm run wpt:ensure | |
| - run: npm run wpt:selection:check | |
| - run: npm run wpt:test | |
| - run: npm run wpt:check:strict | |
| - run: npm run wpt:report -- --output wpt-report.md | |
| if: always() && hashFiles('wpt-results.json') != '' | |
| - run: npm run ci:evidence -- --output ci-evidence.json | |
| - name: Write WPT manifest summary | |
| if: always() | |
| run: npm run wpt:manifest > wpt-manifest.txt | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: wpt-manifest-${{ matrix.os }}-node-${{ matrix.node }} | |
| path: | | |
| wpt-manifest.json | |
| wpt-manifest.txt | |
| wpt-report.md | |
| wpt-results.json | |
| ci-evidence.json | |
| verify-ci-evidence: | |
| name: Verify CI evidence | |
| runs-on: ubuntu-latest | |
| needs: build-test | |
| if: always() | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wpt-manifest-* | |
| path: ci-artifacts | |
| - run: npm run ci:evidence:check -- --artifacts ci-artifacts |