Skip to content

Commit 378249a

Browse files
committed
ci: add NuGet and Playwright browser caching
1 parent bbbb4b0 commit 378249a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,34 @@ jobs:
2929
with:
3030
dotnet-version: '8.0.x'
3131

32+
- name: Cache NuGet packages
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.nuget/packages
36+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
37+
restore-keys: ${{ runner.os }}-nuget-
38+
3239
- name: Restore & build
3340
run: |
3441
dotnet restore AutomationExercise.Tests/AutomationExercise.Tests.csproj
3542
dotnet build AutomationExercise.Tests/AutomationExercise.Tests.csproj \
3643
--no-restore --configuration Release
3744
45+
- name: Cache Playwright browsers
46+
id: playwright-cache
47+
uses: actions/cache@v4
48+
with:
49+
path: ~/.cache/ms-playwright
50+
key: ${{ runner.os }}-playwright-1.58.0
51+
3852
- name: Install Playwright browsers
53+
if: steps.playwright-cache.outputs.cache-hit != 'true'
3954
run: pwsh AutomationExercise.Tests/bin/Release/net8.0/playwright.ps1 install chromium --with-deps
4055

56+
- name: Install Playwright system dependencies
57+
if: steps.playwright-cache.outputs.cache-hit == 'true'
58+
run: pwsh AutomationExercise.Tests/bin/Release/net8.0/playwright.ps1 install-deps chromium
59+
4160
- name: Configure credentials
4261
env:
4362
TEST_USER_EMAIL: ${{ secrets.SEC1 }}
@@ -82,15 +101,34 @@ jobs:
82101
with:
83102
dotnet-version: '8.0.x'
84103

104+
- name: Cache NuGet packages
105+
uses: actions/cache@v4
106+
with:
107+
path: ~/.nuget/packages
108+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
109+
restore-keys: ${{ runner.os }}-nuget-
110+
85111
- name: Restore & build
86112
run: |
87113
dotnet restore AutomationExercise.Tests/AutomationExercise.Tests.csproj
88114
dotnet build AutomationExercise.Tests/AutomationExercise.Tests.csproj \
89115
--no-restore --configuration Release
90116
117+
- name: Cache Playwright browsers
118+
id: playwright-cache
119+
uses: actions/cache@v4
120+
with:
121+
path: ~/.cache/ms-playwright
122+
key: ${{ runner.os }}-playwright-1.58.0
123+
91124
- name: Install Playwright browsers
125+
if: steps.playwright-cache.outputs.cache-hit != 'true'
92126
run: pwsh AutomationExercise.Tests/bin/Release/net8.0/playwright.ps1 install chromium --with-deps
93127

128+
- name: Install Playwright system dependencies
129+
if: steps.playwright-cache.outputs.cache-hit == 'true'
130+
run: pwsh AutomationExercise.Tests/bin/Release/net8.0/playwright.ps1 install-deps chromium
131+
94132
- name: Configure credentials
95133
env:
96134
TEST_USER_EMAIL: ${{ secrets.SEC1 }}

0 commit comments

Comments
 (0)