Skip to content

Commit

Permalink
Simplify .NET pipeline caching (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
veikkoeeva authored Feb 27, 2025
1 parent b74eb47 commit 1589c6d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 92 deletions.
125 changes: 59 additions & 66 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,62 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-stryker": {
"version": "4.4.1",
"commands": [
"dotnet-stryker"
],
"rollForward": false
},
"sharpfuzz.commandline": {
"version": "2.1.1",
"commands": [
"sharpfuzz"
],
"rollForward": false
},
"dotnet-reportgenerator-globaltool": {
"version": "5.4.2",
"commands": [
"reportgenerator"
],
"rollForward": false
},
"microsoft.sbom.dotnettool": {
"version": "3.0.0",
"commands": [
"sbom-tool"
],
"rollForward": false
},
"husky": {
"version": "0.7.2",
"commands": [
"husky"
],
"rollForward": false
},
"dotnet-coverage": {
"version": "17.13.1",
"commands": [
"dotnet-coverage"
],
"rollForward": false
},
"dotnet-validate": {
"version": "0.0.1-preview.304",
"commands": [
"dotnet-validate"
],
"rollForward": false
},
"nallixion.winsharpfuzz.instrument": {
"version": "0.1.0-alpha.1",
"commands": [
"winsharpfuzz-instrument"
],
"rollForward": false
},
"nallixion.winsharpfuzz.commandline": {
"version": "0.1.0-alpha.1",
"commands": [
"winsharpfuzz"
],
"rollForward": false
"version": 1,
"isRoot": true,
"tools": {
"dotnet-stryker": {
"version": "4.5.1",
"commands": [
"dotnet-stryker"
],
"rollForward": false
},
"sharpfuzz.commandline": {
"version": "2.2.0",
"commands": [
"sharpfuzz"
],
"rollForward": false
},
"dotnet-reportgenerator-globaltool": {
"version": "5.4.4",
"commands": [
"reportgenerator"
],
"rollForward": false
},
"microsoft.sbom.dotnettool": {
"version": "3.1.0",
"commands": [
"sbom-tool"
],
"rollForward": false
},
"husky": {
"version": "0.7.2",
"commands": [
"husky"
],
"rollForward": false
},
"dotnet-coverage": {
"version": "17.14.2",
"commands": [
"dotnet-coverage"
],
"rollForward": false
},
"nallixion.winSharpFuzz.instrument": {
"version": "0.1.0-alpha.1",
"commands": [
"winsharpfuzz-instrument"
],
"rollForward": false
},
"nallixion.winsharpfuzz.commandline": {
"version": "0.1.0-alpha.1",
"commands": [
"winsharpfuzz"
],
"rollForward": false
}
}
}
}
39 changes: 14 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,15 @@ jobs:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
fetch-depth: 0
fetch-tags: true

- name: Cache Nuget packages '${{ matrix.os }}'
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{runner.os}}-nuget-
fetch-tags: true

- name: Setup .NET SDK
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab
with:
cache: true
cache-dependency-path: '**/packages.lock.json'
global-json-file: global.json

- name: Setup .NET SDK 6 (temporary until Validate generated NuGet files can use latest .NET)
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab
with:
dotnet-version: 6.x


- name: Install dependencies
run: dotnet restore --locked-mode

Expand Down Expand Up @@ -278,7 +267,7 @@ jobs:

# - name: Upload PR build information artefact
# if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
# uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
# uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1
# with:
# name: 'Test Run'
# path: ${{ github.workspace }}/${{ env.file_name }}
Expand Down Expand Up @@ -313,16 +302,16 @@ jobs:
dotnet pack --verbosity normal --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --output nupkgs --property:PackageVersion=$PACKAGE_VERSION src/$VERIFIABLE_TPM/$VERIFIABLE_TPM.*proj
# Note that on Windows this would be simply "dotnet dotnet-validate package local ./snupkgs/*.nupkg", the handling of an array of paths works directly.
- name: Validate generated NuGet files
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
for file in ./nupkgs/*.nupkg; do
dotnet dotnet-validate package local "$file"
done
# - name: Validate generated NuGet files
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# for file in ./nupkgs/*.nupkg; do
# dotnet dotnet-validate package local "$file"
# done

- name: Upload Verifiable NuGet packages
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1
with:
name: nupkg
path: ./nupkgs/*.*
Expand Down Expand Up @@ -364,7 +353,7 @@ jobs:
ocsp.digicert.com:80
- name: Download NuGet artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
with:
name: nupkg

Expand Down Expand Up @@ -407,7 +396,7 @@ jobs:
ocsp.digicert.com:80
- name: Download NuGet artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
with:
name: nupkg

Expand Down
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<certificate fingerprint="5a2901d6ada3d18260b9c6dfe2133c95d74b9eef6ae0e5dc334c8454d1477df4" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<certificate fingerprint="0E5F38F57DC1BCC806D8494F4F90FBCEDD988B46760709CBEEC6F4219AA6157D" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<certificate fingerprint="1F4B311D9ACC115C8DC8018B5A49E00FCE6DA8E2855F9F014CA6F34570BC482D" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<owners>MarkZither;AnthonyLloyd;pshkarin;Microsoft;9ee1;commandlineparser;DotLiquid;roastedamoeba;NightOwl888;FlorianRappl;wtfsck;zzzprojects;SharpDevelop;jedisct1;xoofx;ApacheLuceneNet;tssdotmsr;Microsoft;dotnetfoundation;albi05;jd.cain.jr;joelhulen;aarnott;AndreyAkinshin;dotnetrdf;kurt;codito;kurtmkurtm;nsec;clairernovotny;Metalnem;sil-lsdev;sedatk;spectresystems;winsharpfuzz;</owners>
<owners>alirezanet;danielpalme;stryker-mutator;MarkZither;AnthonyLloyd;pshkarin;Microsoft;9ee1;commandlineparser;DotLiquid;roastedamoeba;NightOwl888;FlorianRappl;wtfsck;zzzprojects;SharpDevelop;jedisct1;xoofx;ApacheLuceneNet;tssdotmsr;Microsoft;dotnetfoundation;albi05;jd.cain.jr;joelhulen;aarnott;AndreyAkinshin;dotnetrdf;kurt;codito;kurtmkurtm;nsec;clairernovotny;Metalnem;sil-lsdev;sedatk;spectresystems;winsharpfuzz;</owners>
</repository>
</trustedSigners>
</configuration>

0 comments on commit 1589c6d

Please sign in to comment.