Skip to content

Commit cbad0de

Browse files
committed
Update package chaching on CI
1 parent 1954595 commit cbad0de

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

.github/workflows/integration-jobs.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
- '[0-9]+.[0-9]+'
1515
- '[0-9]+.x'
1616

17+
env:
18+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
19+
1720
jobs:
1821
integration-tests:
1922
name: Tests
@@ -34,7 +37,7 @@ jobs:
3437
'8.9.0-SNAPSHOT',
3538
'latest-8'
3639
]
37-
40+
3841
steps:
3942
- name: Checkout
4043
uses: actions/checkout@v3
@@ -43,8 +46,8 @@ jobs:
4346
dotnet-version: '8.0.100'
4447
- uses: actions/cache@v3
4548
with:
46-
path: ~/.nuget/packages
47-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
49+
path: ${{ github.workspace }}/.nuget/packages
50+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}
4851
restore-keys: |
4952
${{ runner.os }}-nuget-
5053
- uses: actions/cache@v3
@@ -53,7 +56,7 @@ jobs:
5356
key: ${{ runner.os }}-elastic-managed-${{ matrix.stack_version }}
5457
restore-keys: |
5558
${{ runner.os }}-elastic-managed-
56-
59+
5760
- run: "./build.sh integrate ${{ matrix.stack_version }} random:test_only_one --report"
5861
name: ${{ matrix.stack_version }}
5962
- name: Results ${{ matrix.stack_version }}
@@ -66,4 +69,4 @@ jobs:
6669
fail_on_failure: true
6770
require_tests: true
6871
check_name: ${{ matrix.stack_version }}
69-
72+

.github/workflows/stale-jobs.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
- '[0-9]+.[0-9]+'
1616
- '[0-9]+.x'
1717

18+
env:
19+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
20+
1821
jobs:
1922
unit-tests:
2023
name: Documentation
@@ -27,14 +30,14 @@ jobs:
2730
dotnet-version: '8.0.100'
2831
- uses: actions/cache@v3
2932
with:
30-
path: ~/.nuget/packages
31-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
33+
path: ${{ github.workspace }}/.nuget/packages
34+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}
3235
restore-keys: |
3336
${{ runner.os }}-nuget-
3437
3538
- run: ./build.sh documentation
3639
name: Build docs
37-
40+
3841
- run: |
3942
if [ -n "$(git status --porcelain)" ]; then echo Error: changes found after running documentation; git diff; git status; exit 1; fi
4043
name: 'Ensure no stale docs'

.github/workflows/test-jobs.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
- '[0-9]+.[0-9]+'
1515
- '[0-9]+.x'
1616

17+
env:
18+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
19+
1720
jobs:
1821
unit-tests:
1922
name: Unit
@@ -26,8 +29,8 @@ jobs:
2629
dotnet-version: '8.0.100'
2730
- uses: actions/cache@v3
2831
with:
29-
path: ~/.nuget/packages
30-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
32+
path: ${{ github.workspace }}/.nuget/packages
33+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}
3134
restore-keys: |
3235
${{ runner.os }}-nuget-
3336
@@ -42,7 +45,7 @@ jobs:
4245
fail_on_failure: true
4346
require_tests: true
4447
check_name: Unit Test Results
45-
48+
4649
# Packages nuget packages first and then uses the nuget packages to test
4750
# Also builds versioned nuget packages
4851
canary-tests:
@@ -56,8 +59,8 @@ jobs:
5659
dotnet-version: '8.0.100'
5760
- uses: actions/cache@v3
5861
with:
59-
path: ~/.nuget/packages
60-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
62+
path: ${{ github.workspace }}/.nuget/packages
63+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}
6164
restore-keys: |
6265
${{ runner.os }}-nuget-
6366
@@ -72,7 +75,7 @@ jobs:
7275
fail_on_failure: true
7376
require_tests: true
7477
check_name: Canary Test Results
75-
78+
7679
# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io
7780
# Only runs on builds on heads
7881
- run: dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.FEEDZ_IO_API_KEY}} -s https://f.feedz.io/elastic/all/nuget/index.json --skip-duplicate --no-symbols

Directory.Build.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
<FileVersion>$(CurrentAssemblyFileVersion)</FileVersion>
1616
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1717
<MajorVersion>$(Version.Split('.')[0])</MajorVersion>
18-
<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.sh))</SolutionRoot>
19-
<ArtifactsPath>$(MSBuildThisFileDirectory).artifacts</ArtifactsPath>
2018
</PropertyGroup>
2119

2220
<!-- Common Nuget metadata-->
@@ -35,8 +33,8 @@
3533
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3634
<IsPackable>false</IsPackable>
3735
<EnablePackageValidation>true</EnablePackageValidation>
38-
<OutputPath Condition="'$(OutputPathBaseDir)' != ''">$(OutputPathBaseDir)\$(MSBuildProjectName)\</OutputPath>
3936
<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))</SolutionRoot>
37+
<ArtifactsPath>$(MSBuildThisFileDirectory).artifacts</ArtifactsPath>
4038

4139
<DefineConstants Condition="'$(TargetFramework)'=='net461' or '$(TargetFramework)'=='net472'">$(DefineConstants);FULLFRAMEWORK</DefineConstants>
4240
<DefineConstants Condition="$(DefineConstants.Contains(FULLFRAMEWORK)) == False">$(DefineConstants);DOTNETCORE</DefineConstants>

build/scripts/Building.fs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ module Build =
2727
"CurrentVersion", (version.Full.ToString());
2828
"CurrentAssemblyVersion", (version.Assembly.ToString());
2929
"CurrentAssemblyFileVersion", (version.AssemblyFile.ToString());
30-
"ContinuousIntegrationBuild", "true";
3130
]
3231
|> List.map (fun (p,v) -> sprintf "%s=%s" p v)
3332
|> String.concat ";"

0 commit comments

Comments
 (0)