Skip to content

Commit

Permalink
Persist test suites and install docker-compose in test jobs to fix co…
Browse files Browse the repository at this point in the history
…nfiguration error

- Modify Prepare Workspace Artifact step to copy wordpress-latest-tests-lib (if it exists) to persist the configured test suites.
- Add steps to install docker-compose in run_php_74_unit_tests and run_php_80_unit_tests jobs.
- Re-create and export the .env file in docker-unit-tests after workspace extraction so that the tests can be run.
- This fixes the error "Run 'configure_test_suites' before running tests" by ensuring that wp-tests-config.php is available in the test environment.
  • Loading branch information
zackkatz committed Feb 17, 2025
1 parent c8befc3 commit 0f344fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ jobs:
- name: Authenticate GitHub for Composer
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: composer config --global --auth github-oauth.github.com $GH_ACCESS_TOKEN
run: composer config --global --auth github-oauth.github.com "$GH_ACCESS_TOKEN"

# Ensure test_dependencies directory exists before caching
- name: Ensure test_dependencies directory exists
run: mkdir -p $HOME/test_dependencies

Expand All @@ -70,11 +71,17 @@ jobs:
GH_AUTH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: bash $HOME/tooling/docker-unit-tests/docker-unit-tests.sh prepare_all

# Persist workspace artifact including test suites
- name: Prepare Workspace Artifact
run: |
mkdir -p workspace_artifact
cp -R $HOME/tooling workspace_artifact/
cp -R $HOME/test_dependencies workspace_artifact/
if [ -d "$HOME/wordpress-latest-tests-lib" ]; then
cp -R $HOME/wordpress-latest-tests-lib workspace_artifact/
else
echo "wordpress-latest-tests-lib not found"
fi
- name: Save Workspace
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -111,6 +118,7 @@ jobs:
rsync -a /tmp/workspace/ $HOME/
fi
# Ensure .env file in docker-unit-tests exists (re-create if necessary)
- name: Ensure .env file in docker-unit-tests exists
run: |
mkdir -p "$HOME/tooling/docker-unit-tests"
Expand Down

0 comments on commit 0f344fc

Please sign in to comment.