Skip to content

Commit

Permalink
Fix workspace artifact extraction with conditional rsync logic
Browse files Browse the repository at this point in the history
- Add a conditional check during artifact extraction to verify if the workspace_artifact subdirectory exists.
- If found, rsync from workspace_artifact; otherwise, rsync directly from the downloaded artifact path.
- This ensures reliable restoration of the workspace files in all jobs.
  • Loading branch information
zackkatz committed Feb 17, 2025
1 parent f5193e7 commit 803963b
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
GH_ACCESS_TOKEN: ${{ secrets.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

- name: Cache Dependencies
uses: actions/cache@v4
with:
Expand All @@ -56,10 +60,6 @@ jobs:
GH_AUTH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: $HOME/tooling/docker-unit-tests/docker-unit-tests.sh prepare_all

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

# Consolidate workspace files into a single directory for upload
- name: Prepare Workspace Artifact
run: |
Expand Down Expand Up @@ -90,7 +90,12 @@ jobs:
path: /tmp/workspace/

- name: Extract Workspace Artifact
run: rsync -a /tmp/workspace/workspace_artifact/ $HOME/
run: |
if [ -d /tmp/workspace/workspace_artifact ]; then
rsync -a /tmp/workspace/workspace_artifact/ $HOME/
else
rsync -a /tmp/workspace/ $HOME/
fi
- name: Run PHP 7.4 Unit Tests
run: $HOME/tooling/docker-unit-tests/docker-unit-tests.sh test_74
Expand All @@ -108,7 +113,12 @@ jobs:
path: /tmp/workspace/

- name: Extract Workspace Artifact
run: rsync -a /tmp/workspace/workspace_artifact/ $HOME/
run: |
if [ -d /tmp/workspace/workspace_artifact ]; then
rsync -a /tmp/workspace/workspace_artifact/ $HOME/
else
rsync -a /tmp/workspace/ $HOME/
fi
- name: Run PHP 8.0 Unit Tests
run: $HOME/tooling/docker-unit-tests/docker-unit-tests.sh test_80
Expand Down Expand Up @@ -149,7 +159,12 @@ jobs:
path: /tmp/workspace/

- name: Extract Workspace Artifact
run: rsync -a /tmp/workspace/workspace_artifact/ $HOME/
run: |
if [ -d /tmp/workspace/workspace_artifact ]; then
rsync -a /tmp/workspace/workspace_artifact/ $HOME/
else
rsync -a /tmp/workspace/ $HOME/
fi
- name: Build and Package
run: |
Expand Down

0 comments on commit 803963b

Please sign in to comment.