Skip to content

Commit 63c2b28

Browse files
committed
Optimize and Enable E2E tests on Windows
1 parent f579adc commit 63c2b28

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

.github/workflows/e2e-tests.yml

+27-11
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,54 @@ jobs:
1212
run-e2e:
1313
strategy:
1414
matrix:
15-
# Disabled windows because it's too slow
16-
# See: https://github.com/NomicFoundation/hardhat/issues/5247
17-
os: [ubuntu-latest, macos-latest]
15+
os: [ubuntu-latest, macos-latest, windows-latest]
1816
name: Run E2E tests on ${{ matrix.os }}
1917
runs-on: ${{ matrix.os }}
2018
env:
21-
# TODO: the e2e tests fail on windows when pnpm is used,
22-
# for what we think is a bug in pnpm. We set this env
23-
# variable to skip that combination until we find a solution.
24-
#
25-
# The failure is caused by `pnpm hardhat init` executing
26-
# `hardhat init` twice on windows, which results in the
27-
# second execution failing because `hardhat init` cannot
28-
# be run on an existing project.
2919
IS_WINDOWS: ${{ matrix.os == 'windows-latest' }}
3020
steps:
3121
- uses: actions/checkout@v4
22+
23+
- name: Cache pnpm modules
24+
uses: actions/cache@v3
25+
with:
26+
path: ~/.pnpm-store
27+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
28+
restore-keys: |
29+
${{ runner.os }}-pnpm-
30+
3231
- uses: pnpm/action-setup@v2
3332
with:
3433
version: 9
34+
3535
- uses: actions/setup-node@v4
3636
with:
3737
node-version: 18
38+
39+
- name: Install dependencies
40+
run: pnpm install
41+
3842
- name: Run fixture-projects script
3943
run: |
4044
cd e2e
4145
chmod +x run-fixture-projects.sh
4246
./run-fixture-projects.sh
4347
shell: bash
48+
if: runner.os != 'Windows'
49+
4450
- name: Run test-project-initialization script
4551
run: |
4652
cd e2e
4753
chmod +x test-project-initialization.sh
4854
./test-project-initialization.sh
4955
shell: bash
56+
if: runner.os != 'Windows'
57+
58+
- name: Run Windows-specific scripts
59+
run: |
60+
cd e2e
61+
.\run-fixture-projects.ps1
62+
.\test-project-initialization.ps1
63+
shell: pwsh
64+
if: runner.os == 'Windows'
65+

0 commit comments

Comments
 (0)