Skip to content

Release 3.13.0 (#1484) #154

Release 3.13.0 (#1484)

Release 3.13.0 (#1484) #154

name: Node.js CI (Windows x86)
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
# Using the same Node versions as the main workflow
node-version: [16.x, 18.x, 20.x, 22.x]
architecture: ["x86"] # 32-bit architecture
steps:
- uses: actions/checkout@v2
# For Windows, we''ll need to use different commands to generate certificates
- name: Generate SSL Certificate
shell: pwsh
run: |
$cert = New-SelfSignedCertificate -Subject "CN=ca,OU=Test,O=Root,L=OpenTelemetryTest,ST=RM,C=CL" -NotAfter (Get-Date).AddDays(1)
$certPath = ".\test\certs\server-cert.pem"
$keyPath = ".\test\certs\server-key.pem"
$certsDir = ".\test\certs"
if (-not (Test-Path $certsDir)) {
New-Item -ItemType Directory -Path $certsDir
}
# Export certificate to PEM format
$certBytesExported = $cert.Export("Cert")
$pemCert = "-----BEGIN CERTIFICATE-----`r`n" + [Convert]::ToBase64String($certBytesExported, [System.Base64FormattingOptions]::InsertLineBreaks) + "`r`n-----END CERTIFICATE-----"
Set-Content -Path $certPath -Value $pemCert
# For the key, we''ll output a placeholder PEM file
# Using secure random bytes for the key content rather than hardcoded text
$randomBytes = New-Object byte[] 32
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($randomBytes)
$randomKeyContent = [Convert]::ToBase64String($randomBytes)
Set-Content -Path $keyPath -Value "-----BEGIN PRIVATE KEY-----`r`n$randomKeyContent`r`n-----END PRIVATE KEY-----"
- name: (Windows x86) on Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.architecture }} # Specify x86 architecture
- run: npm run clean
- name: Install dependencies
run: |
npm i
# Verify diagnostic-channel-publishers is properly installed
if (!(Test-Path -Path node_modules/diagnostic-channel-publishers)) {
npm i diagnostic-channel-publishers --no-save
}
- run: npm run build --if-present
- run: npm run lint
- name: Run tests with mocks
run: |
# Run tests with mock setup to prevent any real network connections
npm run test:mocked