Skip to content

Commit

Permalink
fix: Test reports bugs (#209)
Browse files Browse the repository at this point in the history
* feat: adds allure-report to clean-exclude

* feat: adds cleanup for branch test reports
  • Loading branch information
kukkok3 authored Mar 21, 2024
1 parent 3cdc675 commit 8f717f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/branch-pages-delete.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Branch Pages Deleted
on:
on:
workflow_call:
inputs:
earthfile:
Expand Down Expand Up @@ -61,24 +61,22 @@ jobs:
- name: Set env
run: |
GIT_BRANCH=$(echo ${{ github.event.ref }} | sed -e "s#refs/heads/##g")
DEST_DIR="branch/${GIT_BRANCH//[^a-zA-Z0-9_]/_}"
DEST_DIR_DOCS="branch/${GIT_BRANCH//[^a-zA-Z0-9_]/_}"
DEST_DIR_TESTS="allure-action/${GIT_BRANCH//[^a-zA-Z0-9_-]/_}"
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
echo "DEST_DIR=$DEST_DIR" >> $GITHUB_ENV
echo "DEST_DIR_DOCS=$DEST_DIR_DOCS" >> $GITHUB_ENV
echo "DEST_DIR_TESTS=$DEST_DIR_TESTS" >> $GITHUB_ENV
- name: Clean up
run: |
echo "Clean up for branch ${{ env.GIT_BRANCH }} at ${{ env.DEST_DIR }}"
echo "Clean up for branch ${{ env.GIT_BRANCH }} at ${{ env.DEST_DIR_DOCS }} and ${{ env.DEST_DIR_TESTS }}"
- name: Get current published documentation
uses: actions/checkout@v3
with:
ref: gh-pages

- name: Remove branches draft docs
- name: Remove branches draft docs and test reports
run: |
rm -rf ${{ env.DEST_DIR }}
rm -rf ${{ env.DEST_DIR_DOCS }}
rm -rf ${{ env.DEST_DIR_TESTS}}
- name: Save updated docs
- name: Save updated docs and test reports
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Removed Draft Docs for ${{ env.GIT_BRANCH }}
commit_message: Removed draft docs and test reports for ${{ env.GIT_BRANCH }}
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
if [[ $GIT_BRANCH == "${{ github.event.repository.default_branch }}" ]]; then
DEST_DIR="/"
CLEAN_EXCLUDE="/branch/*"
CLEAN_EXCLUDE="/branch/*\n/allure-action/*"
else
DEST_DIR="/branch/${GIT_BRANCH//[^a-zA-Z0-9_]/_}"
CLEAN_EXCLUDE="/nothing"
Expand Down

0 comments on commit 8f717f9

Please sign in to comment.