[Test] Remove manual composer install, use set up PHP #120
Workflow file for this run
This file contains 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: Test Suite | |
run-name: '[Test] ${{ github.event.head_commit.message }}' | |
on: [push, workflow_dispatch] | |
env: | |
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_TOKEN }}"}}' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
test: ["wpunit", "acceptance"] | |
# wordpress: ["nightly", "6.4", "6.2"] | |
wordpress: ["6.4", "6.2"] | |
#php: ["8.0", "8.3"] | |
php: ["8.0"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php }}" | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- run: bun install --frozen-lockfile | |
# - run: bun rebuild && bun run prepare --if-present | |
- name: Build packages | |
run: bun run build | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
- name: Setup environment | |
run: envsubst < tests/docker-compose.codeception.env > tests/codeception.env | |
- name: Set WordPress Version | |
if: matrix.wordpress != 'nightly' | |
run: sed -i -e 's/WP_TAG=6/WP_TAG=${{ matrix.wordpress }}/g' .env | |
- name: Set WordPress Version | |
if: matrix.wordpress != 'nightly' | |
run: | | |
sed -i -e 's/WP_TAG=6-php8.0/WP_TAG=${{ matrix.wordpress }}-php${{ matrix.php }}/g' .env | |
sed -i -e 's/WP_VERSION=""/WP_VERSION="${{ matrix.wordpress }}"/g' tests/codeception.env | |
- name: Set WordPress Nightly | |
if: matrix.wordpress == 'nightly' | |
run: | | |
sed -i -e 's/WP_VERSION=""/WP_VERSION="nightly"/g' tests/codeception.env | |
- name: Setup docker | |
run: ./bin/setup-docker.sh | |
- name: Run tests | |
run: | | |
bun run test-build | |
bun run test-${{ matrix.test }} | |
- name: Upload codeception output | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "${{ matrix.test }}-${{ matrix.wordpress }}-output" | |
path: "./tests/_output" |