Skip to content

Commit ef2abb4

Browse files
committed
[CI] Added validation that the Clang resource directories match across all builds.
Right now we assume this is true since we only publish the Clang resources from the linux-x64 build. As such we'll want to know if this ever changes for some reason.
1 parent 91e442b commit ef2abb4

File tree

1 file changed

+45
-3
lines changed

1 file changed

+45
-3
lines changed

.github/workflows/ClangSharp.Pathogen.yml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,55 @@ jobs:
308308
if-no-files-found: error
309309
path: '**'
310310

311+
# =====================================================================================================================================================================
312+
# Verify Clang Resources Match
313+
# =====================================================================================================================================================================
314+
# We only use the linux-x64 build to publish ClangSharp.Pathogen.ClangResources, so we want to ensure they match across all builds
315+
verify-clang-resources:
316+
name: Verify Clang Resources
317+
runs-on: ubuntu-latest
318+
needs: build-llvm
319+
steps:
320+
# ----------------------------------------------------------------------- Download LLVM Build Outputs
321+
- name: Download LLVM Windows x64 build output
322+
if: always()
323+
uses: actions/download-artifact@v2
324+
with:
325+
name: llvm-win-x64
326+
- name: Download LLVM Linux x64 build output
327+
if: always()
328+
uses: actions/download-artifact@v2
329+
with:
330+
name: llvm-linux-x64
331+
- name: Download LLVM Linux ARM64 build output
332+
if: always()
333+
uses: actions/download-artifact@v2
334+
with:
335+
name: llvm-linux-arm64
336+
- name: Download LLVM macOS x64 build output
337+
if: always()
338+
uses: actions/download-artifact@v2
339+
with:
340+
name: llvm-osx-x64
341+
342+
# ----------------------------------------------------------------------- Verify
343+
- name: Verify Windows x64 matches Linux x64
344+
if: always()
345+
run: diff --unified --strip-trailing-cr --recursive bin/llvm/linux-x64/lib/clang/ bin/llvm/win-x64/lib/clang/
346+
- name: Verify Linux ARM64 matches Linux x64
347+
if: always()
348+
run: diff --unified --strip-trailing-cr --recursive bin/llvm/linux-x64/lib/clang/ bin/llvm/linux-arm64/lib/clang/
349+
- name: Verify macOS x64 matches Linux x64
350+
if: always()
351+
run: diff --unified --strip-trailing-cr --recursive bin/llvm/linux-x64/lib/clang/ bin/llvm/osx-x64/lib/clang/
352+
311353
# =====================================================================================================================================================================
312354
# Publish NuGet Packages to GitHub
313355
# =====================================================================================================================================================================
314356
publish-packages-github:
315357
name: Publish to GitHub
316358
runs-on: ubuntu-latest
317-
needs: coalesce-packages
359+
needs: [coalesce-packages, verify-clang-resources]
318360
# Pushes to main always publish CI packages
319361
# Published releases always publish packages
320362
# A manual workflow only publishes packages if explicitly enabled
@@ -380,7 +422,7 @@ jobs:
380422
publish-packages-nuget-org:
381423
name: Publish to NuGet.org
382424
runs-on: ubuntu-latest
383-
needs: coalesce-packages
425+
needs: [coalesce-packages, verify-clang-resources]
384426
environment: NuGet.org
385427
# Release builds always publish packages to NuGet.org
386428
# Workflow dispatch builds will only publish packages if enabled and an explicit version number is given
@@ -410,7 +452,7 @@ jobs:
410452
# =====================================================================================================================================================================
411453
send-ci-failure-notification:
412454
name: Send CI Failure Notification
413-
needs: [build-llvm, build-dotnet, coalesce-packages, publish-packages-github, publish-packages-nuget-org]
455+
needs: [build-llvm, build-dotnet, coalesce-packages, verify-clang-resources, publish-packages-github, publish-packages-nuget-org]
414456
if: failure() && github.event_name != 'pull_request'
415457
continue-on-error: true
416458
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)