diff --git a/.github/workflows/pkg-binary.yml b/.github/workflows/pkg-binary.yml index 7d6b4ae3b..214d682f6 100644 --- a/.github/workflows/pkg-binary.yml +++ b/.github/workflows/pkg-binary.yml @@ -36,7 +36,7 @@ on: jobs: pkg-binary: - runs-on: ${{ inputs.arch == 'arm64' && 'macos-15' || 'ubuntu-24.04' }} + runs-on: ${{ inputs.arch == 'arm64' && 'macos-26' || 'ubuntu-24.04' }} env: TERM: xterm steps: diff --git a/.github/workflows/pr-core-tests.yml b/.github/workflows/pr-core-tests.yml index 28faa36ca..73ab1f931 100644 --- a/.github/workflows/pr-core-tests.yml +++ b/.github/workflows/pr-core-tests.yml @@ -65,7 +65,7 @@ jobs: node-version: - "20" os: - # - macos-15 + # - macos-26 - ubuntu-24.04 # - windows-2022 shell: diff --git a/.github/workflows/pr-setup-linux-tests.yml b/.github/workflows/pr-setup-linux-tests.yml index e874a47fa..7a02c0524 100644 --- a/.github/workflows/pr-setup-linux-tests.yml +++ b/.github/workflows/pr-setup-linux-tests.yml @@ -54,6 +54,11 @@ jobs: auto-setup: false lando-version: ${{ steps.pkg-action.outputs.file }} telemetry: false + - name: Get default Docker Engine version + id: docker-engine + run: | + version=$(node -p "require('./utils/get-config-defaults')({}).setup.buildEngine") + echo "version=$version" >> "$GITHUB_OUTPUT" - name: Run Leia Tests uses: lando/run-leia-action@v2 with: @@ -61,3 +66,6 @@ jobs: cleanup-header: "Destroy tests" shell: bash stdin: true + - name: Verify Docker Engine ${{ steps.docker-engine.outputs.version }} + if: matrix.leia-test == 'setup-linux' + run: test "$(docker version --format '{{.Server.Version}}')" = "${{ steps.docker-engine.outputs.version }}" diff --git a/.github/workflows/pr-setup-macos-tests.yml b/.github/workflows/pr-setup-macos-tests.yml index d091ff983..b0db1c02f 100644 --- a/.github/workflows/pr-setup-macos-tests.yml +++ b/.github/workflows/pr-setup-macos-tests.yml @@ -1,10 +1,7 @@ name: Setup macOS Tests on: - # pull_request: - push: - branches: - - SKIPFORNOW + pull_request: jobs: leia-tests: @@ -14,12 +11,10 @@ jobs: strategy: fail-fast: false matrix: - leia-test: - - setup-macos node-version: - "20" os: - - macos-15 + - macos-26 steps: - name: Checkout code @@ -56,10 +51,20 @@ jobs: auto-setup: false lando-version: ${{ steps.pkg-action.outputs.file }} telemetry: false - - name: Run Leia Tests + - name: Get default Docker Desktop version + id: docker-desktop + run: | + version=$(node -p "require('./utils/get-config-defaults')({}).setup.buildEngine") + echo "version=$version" >> "$GITHUB_OUTPUT" + - name: Run lando setup tests uses: lando/run-leia-action@v2 with: - leia-test: "./examples/${{ matrix.leia-test }}/README.md" + leia-test: "./examples/setup-macos/README.md" cleanup-header: "Destroy tests" shell: bash stdin: true + - name: Verify Docker Desktop ${{ steps.docker-desktop.outputs.version }} + run: test "$(defaults read /Applications/Docker.app/Contents/Info CFBundleShortVersionString)" = "${{ steps.docker-desktop.outputs.version }}" + # GitHub-hosted macOS runners do not support the nested virtualization + # required to start Docker Desktop. The Windows setup job runs the full + # Docker Desktop smoke test after verifying the installed version. diff --git a/.github/workflows/pr-setup-windows-tests.yml b/.github/workflows/pr-setup-windows-tests.yml index 0b6b5b5e3..eebb00834 100644 --- a/.github/workflows/pr-setup-windows-tests.yml +++ b/.github/workflows/pr-setup-windows-tests.yml @@ -11,8 +11,6 @@ jobs: strategy: fail-fast: false matrix: - leia-test: - - setup-windows node-version: - "20" os: @@ -52,10 +50,35 @@ jobs: auto-setup: false lando-version: ${{ steps.pkg-action.outputs.file }} telemetry: false - - name: Run Leia Tests + - name: Get default Docker Desktop version + id: docker-desktop + shell: pwsh + run: | + $version = node -p "require('./utils/get-config-defaults')({}).setup.buildEngine" + "version=$version" >> $env:GITHUB_OUTPUT + - name: Run lando setup tests uses: lando/run-leia-action@v2 with: - leia-test: "./examples/${{ matrix.leia-test }}/README.md" + leia-test: "./examples/setup-windows/README.md" + cleanup-header: "Destroy tests" + shell: powershell + stdin: true + debug: true + - name: Verify Docker Desktop ${{ steps.docker-desktop.outputs.version }} + shell: pwsh + run: | + $actual = (Get-Item "$env:ProgramFiles\Docker\Docker\Docker Desktop.exe").VersionInfo.ProductVersion + $expected = [regex]::Escape('${{ steps.docker-desktop.outputs.version }}') + if ($actual -notmatch "^$expected(?:\.\d+)*$") { + throw "Expected Docker Desktop ${{ steps.docker-desktop.outputs.version }}, got: $actual" + } + - name: Install LAMP plugin + shell: pwsh + run: lando plugin-add "@lando/lamp@latest" + - name: Run Docker Desktop smoke tests + uses: lando/run-leia-action@v2 + with: + leia-test: "./examples/desktop-smoke/README.md" cleanup-header: "Destroy tests" shell: powershell stdin: true diff --git a/.github/workflows/pr-unit-tests.yml b/.github/workflows/pr-unit-tests.yml index c528b000a..5477174f4 100644 --- a/.github/workflows/pr-unit-tests.yml +++ b/.github/workflows/pr-unit-tests.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: - - macos-15 + - macos-26 - ubuntu-24.04 - windows-2022 node-version: diff --git a/.github/workflows/sign-binary.yml b/.github/workflows/sign-binary.yml index 9e9b04acb..02d97f4aa 100644 --- a/.github/workflows/sign-binary.yml +++ b/.github/workflows/sign-binary.yml @@ -53,7 +53,7 @@ jobs: environment: signing runs-on: ${{ (contains(inputs.os, 'linux') || contains(inputs.file, 'linux')) && 'ubuntu-24.04' || - (contains(inputs.os, 'macos') || contains(inputs.file, 'macos')) && 'macos-15' || + (contains(inputs.os, 'macos') || contains(inputs.file, 'macos')) && 'macos-26' || (contains(inputs.os, 'win') || contains(inputs.file, 'win')) && 'windows-2022'}} env: TERM: xterm diff --git a/examples/desktop-smoke/.lando.yml b/examples/desktop-smoke/.lando.yml new file mode 100644 index 000000000..8e46b4448 --- /dev/null +++ b/examples/desktop-smoke/.lando.yml @@ -0,0 +1,5 @@ +name: lando-desktop-smoke +recipe: lamp + +plugins: + "@lando/core": ../.. diff --git a/examples/desktop-smoke/README.md b/examples/desktop-smoke/README.md new file mode 100644 index 000000000..90e62c15c --- /dev/null +++ b/examples/desktop-smoke/README.md @@ -0,0 +1,36 @@ +# Docker Desktop Smoke Tests + +This example verifies a tiny LAMP application and its HTTPS proxy against the default Docker Desktop version on Windows. + +## Start up tests + +```bash +# Should start an app with the default Docker Desktop version +lando poweroff +lando start +``` + +## Verification commands + +```bash +# Should discover the running application and database services +lando info --service appserver +lando info --service database + +# Should execute PHP in the application service +lando php -r "echo 'lando-php-is-working';" + +# Should connect PHP to the database +lando php -r '$db = new mysqli("database", "lamp", "lamp", "lamp"); exit($db->connect_errno);' + +# Should serve the application through its HTTPS proxy URL +node -e "const https = require('https'); process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; https.get('https://lando-desktop-smoke.lndo.site', response => { let body = ''; response.on('data', chunk => body += chunk); response.on('end', () => { if (response.statusCode !== 200 || !body.includes('lando-lamp-https-is-working')) process.exit(1); }); }).on('error', error => { console.error(error); process.exit(1); });" +``` + +## Destroy tests + +```bash +# Should destroy the app and shared services +lando destroy -y +lando poweroff +``` diff --git a/examples/desktop-smoke/index.php b/examples/desktop-smoke/index.php new file mode 100644 index 000000000..4bb141d0d --- /dev/null +++ b/examples/desktop-smoke/index.php @@ -0,0 +1,10 @@ +connect_errno) { + http_response_code(500); + exit('database connection failed'); +} + +echo 'lando-lamp-https-is-working'; diff --git a/examples/setup-macos/README.md b/examples/setup-macos/README.md index 320a09faf..25c304bcd 100644 --- a/examples/setup-macos/README.md +++ b/examples/setup-macos/README.md @@ -16,8 +16,8 @@ lando plugin-add "@lando/core@file:../.." brew uninstall --force --ignore-dependencies docker-desktop brew list --versions docker-desktop || echo $? | grep 1 -# Should be able to run lando setup -lando setup -y --skip-networking --skip-common-plugins +# Should be able to run lando setup without installing the CA in CI +lando setup -y --skip-install-ca --skip-networking --skip-common-plugins # Should have installed Docker Desktop stat /Applications/Docker.app @@ -28,7 +28,4 @@ find ~/.lando/bin -type f -name 'docker-compose-v2*' -exec {} version \; # Should have created the Lando Development CA stat ~/.lando/certs/LandoCA.crt - -# Should have installed the Lando Development CA -security find-certificate -a -c "Lando Development CA" -p ~/Library/Keychains/login.keychain-db ```