Skip to content

Bump @actions/core from 1.10.1 to 1.11.1 #473

Bump @actions/core from 1.10.1 to 1.11.1

Bump @actions/core from 1.10.1 to 1.11.1 #473

Workflow file for this run

on:
pull_request:
branches:
- master
push:
jobs:
build_test_job:
name: 'Build and test job'
permissions:
issues: write
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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: cleanup node_modules
shell: pwsh
run: |
if (Test-Path -Path node_modules) {
Remove-Item -Path node_modules -Recurse -Force
}
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 16
- 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' && github.event_name == 'pull_request'
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh # help actionlinter to distinguish the correct shell being used
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}`" }"
test_action_job:
name: 'Execute the local action'
runs-on: ${{ matrix.os }}
needs: build_test_job
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: 'Checking out repo code'
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Test the local action
uses: ./ # Uses an action in the root directory
with:
files: './src/Tests/Resources/test.json'
env:
ID: "Value from workflow"
glossary.GlossDiv.GlossList.GlossEntry.ID: "Value from workflow"
glossary.title: "Fake title"
- name: Validate the test file
shell: pwsh
run: |
$test_file = Get-Content -Path src\Tests\Resources\test.json -Raw
Write-Host $test_file