Improve copying of PHP and legacy CLI files #354
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 | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
# do not enable cache here, because golangci-linter | |
# has its own internal cache with better performance | |
go-version: 1.22.x | |
- name: Create fake PHP and .phar files | |
run: | | |
# These are needed so that the linter does not complain | |
touch internal/legacy/archives/platform.phar | |
touch internal/legacy/archives/php_windows_amd64 | |
touch internal/legacy/archives/php_linux_amd64 | |
touch internal/legacy/archives/php_linux_arm64 | |
touch internal/legacy/archives/php_darwin_amd64 | |
touch internal/legacy/archives/php_darwin_arm64 | |
touch internal/config/embedded-config.yaml | |
touch internal/legacy/archives/php_windows.zip.sha256 | |
- name: Run linter | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.59 | |
- name: Run tests | |
run: make test | |
test-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.22 | |
- name: Run tests | |
run: make test GOOS=windows GOARCH=amd64 | |
- name: Prepare build | |
run: | | |
make internal/legacy/archives/platform.phar php GOOS=windows GOARCH=amd64 | |
- name: Build using GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: build --single-target --id=platform --snapshot --clean | |
- name: Test CLI commands | |
run: | | |
dist\platform_windows_amd64_v1\platform.exe --version |