Skip to content

Commit

Permalink
Install docker-compose in test jobs and re-create .env file after wor…
Browse files Browse the repository at this point in the history
…kspace extraction

- Add a step to install docker-compose in both run_php_74_unit_tests and run_php_80_unit_tests.
- Re-create the .env file in $HOME/tooling/docker-unit-tests after workspace extraction to ensure it exists.
- Export ENV_FILE before running tests so that the script's source command receives a valid file.
- This fixes the "docker-compose system command must be installed" error and ensures proper sourcing.
  • Loading branch information
zackkatz committed Feb 17, 2025
1 parent 873cb5a commit 4285718
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
- name: Authenticate with GitHub CLI
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: |
echo "$GH_ACCESS_TOKEN" | gh auth login --with-token
run: echo "$GH_ACCESS_TOKEN" | gh auth login --with-token

- name: Clone GV Tooling
run: gh repo clone GravityKit/Tooling $HOME/tooling
Expand All @@ -45,9 +44,8 @@ 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_AUTH_TOKEN

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

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

# Consolidate workspace files into a single directory for upload
- name: Prepare Workspace Artifact
run: |
mkdir -p workspace_artifact
Expand All @@ -95,6 +92,11 @@ jobs:
HOME: /home/runner
needs: prepare_test_and_build_environment
steps:
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Restore Workspace
uses: actions/download-artifact@v4
with:
Expand All @@ -109,7 +111,6 @@ jobs:
rsync -a /tmp/workspace/ $HOME/
fi
# Re-create the .env file in docker-unit-tests after extraction (in case it was overwritten)
- name: Ensure .env file in docker-unit-tests exists
run: |
mkdir -p "$HOME/tooling/docker-unit-tests"
Expand All @@ -132,6 +133,11 @@ jobs:
HOME: /home/runner
needs: prepare_test_and_build_environment
steps:
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Restore Workspace
uses: actions/download-artifact@v4
with:
Expand All @@ -146,7 +152,6 @@ jobs:
rsync -a /tmp/workspace/ $HOME/
fi
# Re-create the .env file in docker-unit-tests after extraction
- name: Ensure .env file in docker-unit-tests exists
run: |
mkdir -p "$HOME/tooling/docker-unit-tests"
Expand Down

0 comments on commit 4285718

Please sign in to comment.