Skip to content

[Test] quote version strings #135

[Test] quote version strings

[Test] quote version strings #135

Workflow file for this run

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: Set UID and GID for docker
run: |
printf 'UID=%d\nGID=%d\n' $(id -u) $(id -g) > .env.ci
- name: Start project containers
run: docker compose --env-file .env --env-file .env.ci up -d
- name: Wait for project to be ready
run: ./bin/wait-for-it.sh http://localhost:7253
- 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"