Repository navigation
[#3276] Added Windows CI for the installer and the WSL2 stack, and fixed the installer's Windows path, line ending and symlink handling. #3304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8fcb1a1
[#3276] Ran 'git init' and the PHAR build without '/dev/null' redirec…
AlexSkrypnyk 958fdf2
[#3276] Added Windows CI jobs for the installer suite and for buildin…
AlexSkrypnyk d57ac69
[#3276] Split the 'git init' arguments to satisfy the array line leng…
AlexSkrypnyk 6301e3b
[#3276] Wrote the install report and update registry with LF line end…
AlexSkrypnyk 8880a8a
[#3276] Installed PHP and Composer in the WSL2 distribution for the h…
AlexSkrypnyk 2f733c5
[#3276] Capped the Windows installer test step and uploaded its strea…
AlexSkrypnyk ffd57ef
[#3276] Normalized relative template paths to '/' so pruning excluded…
AlexSkrypnyk d36249f
[#3276] Normalized Windows path separators in 'File::toRelative()', '…
AlexSkrypnyk 5a7bc0f
[#3276] Made Git test repos removable on Windows and skipped the test…
AlexSkrypnyk 5b5e4b9
[#3276] Treated '/' as the separator for the profile and webroot valu…
AlexSkrypnyk af0c731
[#3276] Restored the working directory before the workspace is remove…
AlexSkrypnyk 1e5c213
[#3276] Removed the working directory restore from the installer test…
AlexSkrypnyk dd58969
[#3276] Updated 'alexskrypnyk/prompty' to 1.3.2 and 'alexskrypnyk/php…
AlexSkrypnyk 6bf64fe
[#3276] Copied the template and the extracted archive with relative s…
AlexSkrypnyk 58f8c8a
[#3276] Skipped the post-copy hash check when the staged copy cannot …
AlexSkrypnyk c3a5f13
[#3276] Suppressed the 'hash_file()' warning for a staged path behind…
AlexSkrypnyk eeabcdd
[#3276] Removed the PHAR left by the test suite before the Windows PH…
AlexSkrypnyk aaae908
[#3276] Removed the 'prompty' VCS repository from the installer so 'a…
AlexSkrypnyk 8c09f2f
[#3276] Replaced the hand-rolled separator conversion with 'File::toF…
AlexSkrypnyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| # This action is used for Vortex maintenance. It will not be used in the scaffolded project. | ||
| name: Vortex - Test on Windows | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - release/** | ||
| - project/** | ||
| - '*.x' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - feature/** | ||
| - bugfix/** | ||
| - release/** | ||
| - project/** | ||
| - '*.x' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| # Installs the template with native Windows PHP, then builds and runs the | ||
| # stack with Docker Engine inside a WSL2 distribution. | ||
| vortex-test-windows-stack: | ||
| runs-on: windows-latest | ||
|
|
||
| timeout-minutes: 90 | ||
|
|
||
| permissions: | ||
| contents: read # Checkout the repository; no GITHUB_TOKEN writes are performed. | ||
|
|
||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN || github.token }} | ||
| COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.TEST_GITHUB_TOKEN || github.token }}"}}' | ||
| PACKAGE_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN || github.token }} | ||
| VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }} | ||
| VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }} | ||
| AHOY_CONFIRM_RESPONSE: y | ||
| AHOY_CONFIRM_WAIT_SKIP: 1 | ||
| # Variables passed from Windows into WSL; '/p' converts the path. | ||
| WSLENV: PACKAGE_TOKEN:VORTEX_CONTAINER_REGISTRY_USER:VORTEX_CONTAINER_REGISTRY_PASS:AHOY_CONFIRM_RESPONSE:AHOY_CONFIRM_WAIT_SKIP:RUNNER_TEMP/p | ||
|
|
||
| steps: | ||
| # The installer downloads the template as an archive, which keeps LF line | ||
| # endings and symlinks, so the checkout must match it byte for byte. | ||
| - name: Keep line endings on checkout | ||
| run: git config --global core.autocrlf false | ||
|
|
||
| - name: Keep symlinks on checkout | ||
| run: git config --global core.symlinks true | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2 | ||
| with: | ||
| php-version: '8.4' | ||
| coverage: none | ||
|
|
||
| - name: Set default branch name | ||
| run: git config --global init.defaultBranch main | ||
|
|
||
| - name: Install installer dependencies | ||
| run: composer install | ||
| working-directory: .vortex/installer | ||
|
|
||
| - name: Install Vortex from the checkout on Windows | ||
| run: php .vortex/installer/installer.php --no-interaction --uri="$env:GITHUB_WORKSPACE" --destination="$env:RUNNER_TEMP\star_wars" | ||
|
|
||
| - name: Setup WSL2 | ||
| uses: Vampire/setup-wsl@4c48163d9f981914dd8caa0fc335fe19cca5bff4 # v7.2.0 | ||
| with: | ||
| distribution: Ubuntu-24.04 | ||
| wsl-version: '2' | ||
| # Ahoy bootstraps the tooling package on the host with PHP and Composer. | ||
| additional-packages: curl ca-certificates git unzip docker.io docker-compose-v2 docker-buildx php-cli php-curl php-mbstring php-xml php-zip composer | ||
|
|
||
| - name: Start Docker in WSL2 | ||
| shell: wsl-bash {0} | ||
| run: | | ||
| service docker start | ||
| timeout 60 sh -c 'until docker info >/dev/null 2>&1; do sleep 1; done' | ||
| docker version | ||
| docker compose version | ||
|
|
||
| - name: Install Ahoy in WSL2 | ||
| shell: wsl-bash {0} | ||
| run: | | ||
| version=2.4.0 | ||
| curl -fsSL -o /usr/local/bin/ahoy "https://github.com/ahoy-cli/ahoy/releases/download/v${version}/ahoy-bin-linux-amd64" | ||
| chmod +x /usr/local/bin/ahoy | ||
| ahoy --version | ||
|
|
||
| - name: Login to container registry | ||
| if: env.VORTEX_CONTAINER_REGISTRY_USER != '' | ||
| shell: wsl-bash {0} | ||
| run: echo "${VORTEX_CONTAINER_REGISTRY_PASS}" | docker login --username "${VORTEX_CONTAINER_REGISTRY_USER}" --password-stdin | ||
|
|
||
| # Docker runs inside the distribution, so the project lives on its own | ||
| # filesystem and bind mounts behave as on a Windows workstation. | ||
| - name: Copy the project into WSL2 | ||
| shell: wsl-bash {0} | ||
| run: cp -a "${RUNNER_TEMP}/star_wars" /root/star_wars | ||
|
|
||
| - name: Check the project has no CRLF line endings | ||
| shell: wsl-bash {0} | ||
| run: | | ||
| if grep -rlI $'\r' --exclude-dir=.git /root/star_wars; then | ||
| echo "Files above contain CRLF line endings." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Stand-ins for the network and SSH agent container that Pygmy provides. | ||
| - name: Start local routing stubs | ||
| shell: wsl-bash {0} | ||
| run: | | ||
| docker network create amazeeio-network | ||
| docker run --detach --name amazeeio-ssh-agent pygmystack/ssh-agent | ||
|
|
||
| - name: Build the stack | ||
| shell: wsl-bash {0} | ||
| run: | | ||
| cd /root/star_wars | ||
| ahoy build | ||
|
|
||
| - name: Check the site responds | ||
| shell: wsl-bash {0} | ||
| run: | | ||
| cd /root/star_wars | ||
| docker compose exec -T cli curl -fsSL --output /dev/null http://nginx:8080 | ||
|
|
||
| - name: Check Ahoy commands | ||
| shell: wsl-bash {0} | ||
| run: | | ||
| cd /root/star_wars | ||
| ahoy info | ||
| ahoy drush status | ||
| ahoy lint | ||
| ahoy test-unit | ||
|
|
||
| - name: Show container logs | ||
| if: failure() | ||
| shell: wsl-bash {0} | ||
| run: | | ||
| cd /root/star_wars | ||
| docker compose logs --tail 200 | ||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.