php setup #47
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: Tests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| workflow_call: | |
| jobs: | |
| phpunit: | |
| name: PHP Unit Testing | |
| runs-on: ubuntu-latest | |
| container: | |
| image: codeccoop/wp-test | |
| steps: | |
| - name: Start MariaDB | |
| run: nohup docker-entrypoint.sh mariadbd 2>&1 >/dev/null & | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Cache composer | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('composer.lock') }} | |
| - name: Cache plugins | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/*.zip | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('bin/download-test-deps.sh') }} | |
| - name: Composer install | |
| run: composer -q install | |
| - name: Wait for MariaDB | |
| run: sleep 5 | |
| - name: Executable mode | |
| run: chmod a+x bin/* | |
| - name: Install tests suite | |
| run: bin/install-wp-tests.sh | |
| - name: Download deps | |
| run: bin/download-test-deps.sh | |
| - name: Unit testing | |
| run: vendor/bin/phpunit -c phpunit.xml.dist |