WSL Test #422
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
| name: CI | |
| on: | |
| push: | |
| branches: [ main, wsl-test ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_call: | |
| concurrency: | |
| group: ci-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 | |
| with: | |
| version: latest | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 | |
| with: | |
| node-version: '20' | |
| - name: Install prettier | |
| run: npm install --no-save prettier | |
| - name: Check markdown formatting | |
| run: | | |
| npx prettier --check "**/*.md" || (echo "Please run 'npx prettier --write \"**/*.md\"' to format your markdown files" && exit 1) | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run fast tests | |
| run: go test -v -race ./internal/... | |
| - name: Set up Lima | |
| uses: lima-vm/lima-actions/setup@03b96d61959e83b2c737e44162c3088e81de0886 # v1.0.1 | |
| id: lima-actions-setup | |
| - name: Cache ~/.cache/lima | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/.cache/lima | |
| key: lima-${{ steps.lima-actions-setup.outputs.version }} | |
| - name: Run e2e tests | |
| run: go test -v ./e2e/... | |
| wsl: | |
| name: WSL Test | |
| runs-on: windows-11-arm | |
| steps: | |
| - name: Check | |
| run: | | |
| # 1) Is virtualization exposed to the VM? | |
| systeminfo | findstr /i "Hyper-V Requirements" | |
| # 2) Are the required Windows optional features enabled? | |
| Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux,VirtualMachinePlatform,Microsoft-Hyper-V-All | | |
| Select FeatureName, State | |
| # 3) Is the hypervisor set to launch? | |
| bcdedit /enum | findstr /i hypervisorlaunchtype | |
| # 4) What does WSL itself say? | |
| wsl --status | |
| - name: Install WSL (Windows) | |
| uses: Vampire/setup-wsl@v6 | |
| with: | |
| distribution: Ubuntu-24.04 | |
| additional-packages: | | |
| openssh-server | |
| docker.io | |
| - name: Setup SSH (Windows - WSL) | |
| shell: wsl-bash {0} | |
| run: | | |
| useradd -G kvm,docker -m -s /bin/bash test | |
| passwd -d test | |
| cat > /etc/ssh/sshd_config.d/01-passwordless-authentication.conf << 'EOF' | |
| PasswordAuthentication yes | |
| PermitEmptyPasswords yes | |
| UsePAM no | |
| EOF | |
| systemctl daemon-reload | |
| systemctl restart ssh |