Skip to content

Bump codecov/codecov-action from 5.3.1 to 5.4.0 #2570

Bump codecov/codecov-action from 5.3.1 to 5.4.0

Bump codecov/codecov-action from 5.3.1 to 5.4.0 #2570

Workflow file for this run

name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
FORCE_COLOR: 1
POWERSHELL_YAML_VERSION: '0.4.12'
PSSCRIPTANALYZER_VERSION: '1.23.0'
permissions:
contents: read
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
attestations: write
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
os-name: macos
- os: ubuntu-latest
os-name: linux
- os: windows-latest
os-name: windows
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false
- name: Setup Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '20.x'
- name: Get npm cache directory
id: npm-cache-dir
shell: pwsh
run: |
"dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT}
- name: Setup npm cache
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install packages
run: npm ci
- name: Build and Test
shell: pwsh
run: ./build.ps1
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
name: Upload coverage to Codecov
with:
flags: ${{ matrix.os-name }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: Generate SBOM
uses: anchore/sbom-action@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # v0.18.0
if: runner.os == 'Linux'
with:
artifact-name: update-dotnet-sdk.spdx.json
output-file: update-dotnet-sdk.spdx.json
path: .
- name: Attest dist
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
if: |
runner.os == 'Linux' &&
github.ref_name == github.event.repository.default_branch
with:
subject-path: ./dist/**/*.js
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
filter: 'tree:0'
show-progress: false
- name: Add actionlint problem matcher
run: echo "::add-matcher::.github/actionlint-matcher.json"
- name: Lint workflows
uses: docker://rhysd/actionlint@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9 # v1.7.7
with:
args: -color
- name: Lint markdown
uses: DavidAnson/markdownlint-cli2-action@05f32210e84442804257b2a6f20b273450ec8265 # v19.1.0
with:
config: '.markdownlint.json'
globs: |
**/*.md
- name: Lint PowerShell in workflows
uses: martincostello/lint-actions-powershell@5942e3350ee5bd8f8933cec4e1185d13f0ea688f # v1.0.0
with:
powershell-yaml-version: ${{ env.POWERSHELL_YAML_VERSION }}
psscriptanalyzer-version: ${{ env.PSSCRIPTANALYZER_VERSION }}
treat-warnings-as-errors: true
- name: Lint PowerShell scripts
shell: pwsh
run: |
$settings = @{
IncludeDefaultRules = $true
Severity = @("Error", "Warning")
}
$issues = Invoke-ScriptAnalyzer -Path ${env:GITHUB_WORKSPACE} -Recurse -ReportSummary -Settings $settings
foreach ($issue in $issues) {
$severity = $issue.Severity.ToString()
$level = $severity.Contains("Error") ? "error" : $severity.Contains("Warning") ? "warning" : "notice"
Write-Output "::${level} file=$($issue.ScriptName),line=$($issue.Line),title=PSScriptAnalyzer::$($issue.Message)"
}
if ($issues.Count -gt 0) {
exit 1
}