Files
dotnet__skills/.github/workflows/skill-validator.yml
dependabot[bot] 1e2fc4f10e Bump the github-actions-dependencies group across 1 directory with 5 updates (#918)
Bumps the github-actions-dependencies group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `6.0.2` | `7.0.0` |
| [actions/cache/restore](https://github.com/actions/cache) | `5.0.5` | `6.1.0` |
| [actions/cache](https://github.com/actions/cache) | `5.0.5` | `6.1.0` |
| [actions/setup-dotnet](https://github.com/actions/setup-dotnet) | `5.2.0` | `6.0.0` |
| [actions/setup-node](https://github.com/actions/setup-node) | `6.4.0` | `7.0.0` |



Updates `actions/checkout` from 6.0.2 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6.0.2...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

Updates `actions/cache/restore` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5.0.5...55cc8345863c7cc4c66a329aec7e433d2d1c52a9)

Updates `actions/cache` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/27d5ce7f107fe9357f9df03efb73ab90386fccae...55cc8345863c7cc4c66a329aec7e433d2d1c52a9)

Updates `actions/setup-dotnet` from 5.2.0 to 6.0.0
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7...a98b56852c35b8e3190ac28c8c2271da59106c68)

Updates `actions/setup-node` from 6.4.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e...820762786026740c76f36085b0efc47a31fe5020)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/cache/restore
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/cache
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/setup-dotnet
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-20 17:01:55 -07:00

194 lines
7.0 KiB
YAML

name: skill-validator
on:
pull_request:
schedule:
- cron: '0 8 * * *' # daily at 08:00 UTC
workflow_dispatch:
inputs:
create_release:
description: 'Create a nightly release after building'
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
env:
RETENTION_DAYS: ${{ (github.event_name == 'schedule' || inputs.create_release) && 90 || 5 }}
AGNOSTIC_RID: linux-x64
jobs:
discover:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
outputs:
has_changes: ${{ steps.check.outputs.has_changes }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
with:
fetch-depth: 0
- name: Check for relevant changes
id: check
shell: pwsh
run: |
$base = "${{ github.event.pull_request.base.sha }}"
$head = "${{ github.event.pull_request.head.sha }}"
$mergeBase = git merge-base $base $head
$changed = git diff --name-only $mergeBase $head |
Where-Object { $_ -match '^(eng/skill-validator/|\.github/workflows/skill-validator\.yml$)' -and $_ -notmatch '^eng/skill-validator/src/(README\.md|docs/)' } |
Select-Object -First 1
if ($changed) {
echo "has_changes=true" >> $env:GITHUB_OUTPUT
} else {
echo "has_changes=false" >> $env:GITHUB_OUTPUT
}
build:
needs: discover
# Don't run scheduled builds on forked repositories — forks that enable
# Actions would otherwise consume the fork owner's minutes indefinitely.
# For PRs, skip when no relevant files changed (discover job).
if: >-
always() &&
!(github.event_name == 'schedule' && github.event.repository.fork) &&
(needs.discover.result == 'skipped' || needs.discover.outputs.has_changes == 'true')
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
- os: ubuntu-24.04-arm
rid: linux-arm64
- os: windows-latest
rid: win-x64
- os: windows-11-arm
rid: win-arm64
- os: macos-latest
rid: osx-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
with:
persist-credentials: false
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v5
with:
global-json-file: global.json
- name: Build
run: dotnet build eng/skill-validator/SkillValidator.slnx /bl:artifacts/logs/build.binlog
- name: Test
run: dotnet test --solution eng/skill-validator/SkillValidator.slnx --no-build /bl:artifacts/logs/test.binlog
- name: Pack RID-specific NuGet package
run: dotnet pack eng/skill-validator/src/SkillValidator.csproj --use-current-runtime /bl:artifacts/logs/pack-rid.binlog
- name: Upload RID-specific NuGet package
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: skill-validator-${{ matrix.rid }}
path: artifacts/package/release/Microsoft.DotNet.SkillValidator.${{ matrix.rid }}.*.nupkg
archive: false
retention-days: ${{ env.RETENTION_DAYS }}
if-no-files-found: error
- name: Create tar.gz archive
shell: bash
run: |
mkdir -p artifacts/assets
tar -czf artifacts/assets/skill-validator-${{ matrix.rid }}.tar.gz -C artifacts/publish/SkillValidator/release .
- name: Upload tar.gz archive
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: skill-validator-${{ matrix.rid }}.tar.gz
path: artifacts/assets/skill-validator-${{ matrix.rid }}.tar.gz
archive: false
retention-days: ${{ env.RETENTION_DAYS }}
if-no-files-found: error
- name: Pack RID-agnostic NuGet package
if: matrix.rid == env.AGNOSTIC_RID
run: dotnet pack eng/skill-validator/src/SkillValidator.csproj /bl:artifacts/logs/pack-agnostic.binlog
- name: Upload RID-agnostic NuGet package
if: matrix.rid == env.AGNOSTIC_RID
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
archive: false
name: skill-validator
path: |
artifacts/package/release/Microsoft.DotNet.SkillValidator.*.nupkg
!artifacts/package/release/Microsoft.DotNet.SkillValidator.${{ env.AGNOSTIC_RID }}.*.nupkg
retention-days: ${{ env.RETENTION_DAYS }}
if-no-files-found: error
- name: Upload binlogs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: binlogs-${{ matrix.rid }}
path: artifacts/logs/*.binlog
retention-days: ${{ env.RETENTION_DAYS }}
if-no-files-found: ignore
release:
if: >-
always() &&
needs.build.result == 'success' &&
(github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && inputs.create_release))
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
with:
persist-credentials: true
- name: Download all artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: release-assets
merge-multiple: true
- name: Create or update nightly release
env:
GH_TOKEN: ${{ github.token }}
run: |
tag="skill-validator-nightly"
gh release delete "$tag" --yes || true
git tag -f "$tag"
git push -f origin "$tag"
gh release create "$tag" release-assets/*.nupkg release-assets/*.tar.gz \
--title "SkillValidator Nightly" \
--notes "Automated nightly build from \`main\` ($(date -u +%Y-%m-%d))." \
--prerelease
# Require this job in the GitHub ruleset. It always runs on PRs and
# succeeds when no relevant files changed or the build passed.
skill-validator-status:
needs: [discover, build]
if: always() && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check result
run: |
if [[ "${{ needs.discover.result }}" != "success" ]]; then
echo "::error::Discovery failed (${{ needs.discover.result }})"
exit 1
elif [[ "${{ needs.discover.outputs.has_changes }}" != "true" ]]; then
echo "No skill-validator changes — skipping build"
elif [[ "${{ needs.build.result }}" != "success" ]]; then
echo "::error::Build failed (${{ needs.build.result }})"
exit 1
else
echo "Build and tests passed"
fi