Skip to content

ci: add WSL2 GitHub Actions testing workflow, for #6444 - #8151

Merged
rfay merged 19 commits into
mainfrom
20260216_rfay_wsl_github
Feb 17, 2026
Merged

rfay merged 19 commits into
mainfrom
20260216_rfay_wsl_github

Conversation

@rfay

@rfay rfay commented Feb 17, 2026 •

Copy link
Copy Markdown
Member

The Issue

DDEV's WSL2 integration tests currently run on self-hosted Buildkite agents (physical Windows machines). This PR adds a GitHub Actions workflow to run WSL2 tests with Docker CE on GitHub-hosted runners, reducing dependence on personal hardware infrastructure.

How This PR Solves The Issue

Because workflows like this can't run until on default branch (main), this PR can't be tested, but it's running fine in ddev-test/ddev, https://github.com/ddev-test/ddev/actions/runs/22104960219/job/63884886552

Adds three files:

  • .github/workflows/test-wsl2.yml -- Standalone workflow (not using test-reusable.yml, which is Linux-specific). Runs on windows-2025 with workflow_dispatch trigger for iterating until stable. Installs a WSL2 Ubuntu distro named DDEV, creates a testuser, enables systemd, clones the repo inside WSL2's native filesystem for performance, and runs make test.
  • .github/workflows/wsl2-setup.sh -- Runs as root inside WSL2. Installs Docker CE, Go, build dependencies (aligned with linux-setup.sh), mkcert, ngrok, and cloudflared. Configures testuser with docker group access and passwordless sudo.
  • .github/workflows/wsl2-test.sh -- Runs as testuser inside WSL2. Mirrors the test pattern from test-reusable.yml: make to build, then make test with configurable TESTARGS, GOTEST_SHORT, etc.

Key design decisions:

  • Code is cloned inside WSL2's native filesystem (~/workspace/ddev), not on /mnt/c/..., for performance
  • All WSL commands use single-line wsl -- bash -exc "..." pattern (multi-line heredocs fail due to PowerShell CRLF injection and argument splitting)
  • GOTEST_SHORT=16 (Drupal11 only) to match existing Buildkite behavior and keep runtime manageable
  • Systemd enabled via /etc/wsl.conf with a wsl --shutdown cycle to apply

Known limitations

Mirrored networking: The matrix includes mirrored mode infrastructure (the .wslconfig step, the matrix definition) but it is commented out. Windows Server 2025 does not support WSL2 mirrored networking (microsoft/WSL#11154). Options for future mirrored mode testing are discussed in #6444.

Windows ARM64 runners (windows-11-arm): WSL2 does not work on these runners -- the wsl --install command fails. These runners are consumer Windows 11 on ARM64, which would theoretically support mirrored networking, but WSL2 itself is non-functional there.

tmate on Windows ARM64: If ARM64 runners are used in the future, tmate requires the msys2/setup-msys2@v2 workaround (see action-tmate#216):

- uses: msys2/setup-msys2@v2
  id: setup-msys2
- uses: mxschmitt/action-tmate@v3
  with:
    msys2-location: ${{ steps.setup-msys2.outputs.msys2-location }}

Manual Testing Instructions

  1. Pull it and let it work :)
  2. Go to Actions -> "Test WSL2 (Docker CE)" -> Run workflow
  3. Select the branch, optionally adjust GOTEST_SHORT, TESTARGS, or make_target
  4. Verify: WSL2 installs, Docker CE starts, DDEV builds, tests run

Automated Testing Overview

This PR is itself a CI workflow. It will be validated by running it via workflow_dispatch and confirming test results match existing Buildkite WSL2 runs.

Release/Deployment Notes

  • Does not replace Buildkite WSL2 testing yet; runs in parallel for comparison

rfay and others added 18 commits February 16, 2026 16:37
Adds a workflow_dispatch-only workflow to run DDEV tests inside WSL2
on windows-2025 GitHub Actions runners with Docker CE (native inside
WSL2), replacing the Buildkite wsl2-docker-inside pipeline.

- test-wsl2.yml: orchestrates WSL2 install, setup, clone, and test
- wsl2-setup.sh: installs Docker CE, Go, build deps, creates testuser
- wsl2-test.sh: builds DDEV and runs make test inside WSL2

Uses GOTEST_SHORT=16 (drupal11 only) to match Buildkite behavior.
NAT networking mode only; mirrored mode to be added later.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add mariadb-client, expect, libcurl4-gnutls-dev, and cloudflared
to match the packages installed by linux-setup.sh for other test
workflows.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@rfay
rfay requested a review from a team as a code owner February 17, 2026 15:56
@rfay rfay changed the title ci: add WSL2 GitHub Actions testing workflow, fixes #6444 ci: add WSL2 GitHub Actions testing workflow, for #6444 Feb 17, 2026
@rfay
rfay requested a review from stasadev February 17, 2026 16:21

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@rfay
rfay merged commit 3a26835 into main Feb 17, 2026
4 checks passed
@rfay
rfay deleted the 20260216_rfay_wsl_github branch February 17, 2026 18:54
rfay added a commit to rfay/ddev that referenced this pull request Feb 18, 2026
…ection

## The Issue

- For ddev#8151

PR ddev#8151 added WSL2 testing but builds from forked PRs get incorrect version
numbers (e.g., v1.23.5-846-gbaeb0de45 instead of v1.25.0-xxx). This causes
addon-get tests to fail on version constraint checks because the fork's
remote may not have current upstream tags synced.

## How This PR Solves The Issue

The workflow clones from the fork (for PRs) but only fetches tags from that
fork's remote. Since forks may not have current upstream tags synced, `git
describe` finds old tags like v1.23.5 instead of v1.25.0.

**Changes:**
- Add upstream (ddev/ddev) as a git remote after cloning
- Fetch tags from upstream instead of (or in addition to) origin
- This matches the behavior of `actions/checkout@v5` with `fetch-depth: 0`
  used in other workflows

The clone command now:
1. Clones from fork (preserving PR source)
2. Adds upstream remote (github.repository = ddev/ddev)
3. Fetches tags from upstream (git fetch upstream --tags)
4. git describe now finds correct version tags

## Manual Testing Instructions

1. Create a PR from a fork that doesn't have latest tags synced
2. Trigger the WSL2 workflow
3. Verify the "Clone repository for testuser" step shows correct version
4. Verify addon-get tests pass with proper version detection

## Automated Testing Overview

This fix will be validated by the WSL2 workflow itself. The workflow should
now correctly detect version as v1.25.0-based instead of v1.23.5-based.

## Release/Deployment Notes

- No impact on released artifacts
- Fixes CI testing for PRs from forks

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
rfay added a commit that referenced this pull request Feb 18, 2026
…ection, for #8151 (#8153) [skip buildkite]

Co-authored-by: Claude Sonnet 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants