Files
dotnet__skills/.github/workflows/skill-validator.yml
dependabot[bot] 7079f6c3ae Bump the github-actions-dependencies group with 3 updates (#526)
Bumps the github-actions-dependencies group with 3 updates: [actions/github-script](https://github.com/actions/github-script), [actions/cache](https://github.com/actions/cache) and [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/github-script` from 8.0.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/ed597411d8f924073f98dfc5c65a23a2325f34cd...3a2844b7e9c422d3c10d287c895573f7108da1b3)

Updates `actions/cache` from 5.0.4 to 5.0.5
- [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/668228422ae6a00e4ad889ee87cd7109ec5666a7...27d5ce7f107fe9357f9df03efb73ab90386fccae)

Updates `actions/upload-artifact` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/cache
  dependency-version: 5.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  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-04-15 09:46:36 +02: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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 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