Repository navigation
test(e2e): add WSL suite on windows-2025
#26
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2026 Han Li and contributors | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: E2E | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: e2e-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| e2e-linux: | |
| if: github.repository == 'version-fox/vfox-nodejs' | |
| name: Linux container (${{ matrix.runs-on }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runs-on: [ubuntu-latest, ubuntu-26.04-arm] | |
| runs-on: ${{ matrix.runs-on }} | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - run: docker compose -f tests/e2e/linux/compose.yaml run --rm e2e | |
| e2e-linux-musl: | |
| if: github.repository == 'version-fox/vfox-nodejs' | |
| name: Linux musl container (${{ matrix.runs-on }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runs-on: [ubuntu-latest, ubuntu-26.04-arm] | |
| runs-on: ${{ matrix.runs-on }} | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - run: docker compose -f tests/e2e/linux/compose.alpine.yaml run --rm e2e | |
| e2e-windows: | |
| if: github.repository == 'version-fox/vfox-nodejs' | |
| name: Windows container (${{ matrix.runs-on }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # TODO See https://github.com/actions/runner-images/issues/13729 | |
| runs-on: [windows-latest, windows-11-arm] | |
| include: | |
| - runs-on: windows-latest | |
| compose: tests/e2e/windows/compose.amd64.yaml | |
| - runs-on: windows-11-arm | |
| compose: tests/e2e/windows/compose.arm64.yaml | |
| runs-on: ${{ matrix.runs-on }} | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| # The windows-11-arm runner ships neither Docker for Windows containers | |
| # nor a Go new enough to build moby, so both are provisioned here. | |
| - if: matrix.runs-on == 'windows-11-arm' | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: 1.27.1 | |
| cache: false | |
| - if: matrix.runs-on == 'windows-11-arm' | |
| run: pwsh -NoProfile -File tests/e2e/windows/install-docker-arm64.ps1 | |
| - if: matrix.runs-on == 'windows-11-arm' | |
| name: Install Compose CLI plugin | |
| run: | | |
| New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.docker\cli-plugins" | Out-Null | |
| curl.exe -fsSL "https://github.com/docker/compose/releases/download/v5.5.1/docker-compose-windows-aarch64.exe" -o "$env:USERPROFILE\.docker\cli-plugins\docker-compose.exe" | |
| docker compose version | |
| - run: docker compose -f ${{ matrix.compose }} run --rm --build e2e | |
| e2e-wsl: | |
| if: github.repository == 'version-fox/vfox-nodejs' | |
| name: WSL (windows-2025) | |
| runs-on: windows-2025 | |
| timeout-minutes: 60 | |
| env: | |
| WSL_DISTRO: Ubuntu-24.04 | |
| NODE_VERSION: 20.16.0 | |
| MIRROR: default | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: 1.27.1 | |
| cache: false | |
| # The image ships WSL with --no-distribution: install Ubuntu without | |
| # launching (launch would prompt for user creation), then boot it once | |
| # as root. --web-download skips the Store, which CI cannot reach. | |
| # Regression target: https://github.com/version-fox/vfox-nodejs/issues/32 | |
| - name: Install Ubuntu on WSL | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| wsl --install -d $env:WSL_DISTRO --no-launch --web-download | |
| # The hosted Windows PATH contains entries with spaces and | |
| # parentheses (e.g. Program Files (x86)); WSL appends it by default, | |
| # and `vfox activate` emits an invalid bash export for that PATH. | |
| # This distro is disposable CI state, so disable Windows PATH | |
| # interop for a native Linux shell environment. | |
| wsl -d $env:WSL_DISTRO -u root -- bash -c "printf '[interop]`nappendWindowsPath=false`n' > /etc/wsl.conf" | |
| wsl --shutdown | |
| $deadline = (Get-Date).AddMinutes(10) | |
| do { | |
| wsl -d $env:WSL_DISTRO -u root -e true | |
| if ($LASTEXITCODE -eq 0) { break } | |
| Start-Sleep -Seconds 15 | |
| } while ((Get-Date) -lt $deadline) | |
| if ($LASTEXITCODE -ne 0) { throw 'WSL distro did not boot' } | |
| wsl -l -v | |
| wsl --version | |
| - name: Run WSL E2E | |
| run: go test -v -timeout 55m -run TestE2E ./wsl | |
| working-directory: tests/e2e |