Skip to content

Bump @types/node from 20.2.5 to 20.4.8 #24

Bump @types/node from 20.2.5 to 20.4.8

Bump @types/node from 20.2.5 to 20.4.8 #24

Workflow file for this run

on:
pull_request:
branches:
- master
jobs:
build_test_job:
name: "Build and test job"
permissions:
pull-requests: write
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: "Checking out repo code"
uses: actions/checkout@v3
- name: "Setup Node"
uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- name: "Validate build"
run: |
npm install
npm run build
- name: "Run L0 tests"
run: |
npm run test
- name: "Run test coverage"
if: runner.os == 'Windows'
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$coverage_result = npm run coverage
$start = $false;
$middle = $false;
$end = $false;
$count = 0;
foreach ($j in $coverage_result)
{
if ($j.tostring().startswith("--------------"))
{
if (!$start)
{
$start = $true;
$start_index = $count
}
elseif (!$middle)
{
$middle = $true;
$middle_index = $count
}
elseif (!$end)
{
$end = $true;
$end_index = $count
}
}
$count++
}
$tbl_md = $coverage_result[($start_index+1)..($end_index-1)] -join "\n"
$summary = $coverage_result[($end_index + 1)..$count] -join "\n"
$comment = $tbl_md + "\n" + $summary
$url = "https://api.github.com/repos/${env:GITHUB_REPOSITORY}/issues/${env:PR_NUMBER}/comments"
$headers = @{
"Authorization" = "token ${env:GITHUB_TOKEN}"
}
Invoke-RestMethod -Method POST -Uri $url -Headers $headers -Body "{ `"body`": `"${comment}`" }"