Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix behave #1090

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 49 additions & 80 deletions .github/workflows/behave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,62 +164,59 @@ jobs:
steps:
- uses: actions/checkout@v4

# Fetch Allure History
- name: Get Allure history - Full Report
if: github.event_name == 'schedule' || github.event_name == 'push'
# Fetch existing gh-pages to preserve history if on master branch and it's a push or schedule
- name: Get Existing History
if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule')
uses: actions/checkout@v4
continue-on-error: true
with:
ref: gh-pages
path: gh-pages/allure-full-history

- name: Get Allure history - Partial Report
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
path: allure-history
continue-on-error: true
with:
ref: gh-pages
path: gh-pages/allure-partial-history

# Generate Allure Reports
# If PR doesn't need existing history, we can skip fetching. If you do want partial history across PRs,
# you could add another condition for pull_request here.

# Generate Full Run Allure Reports (push/schedule on master)
- name: Allure report action for Full Run
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master'
uses: simple-elf/allure-report-action@master
if: github.event_name == 'schedule' || github.event_name == 'push'
with:
allure_results: build/${{ matrix.python-version }}/allure-results
subfolder: ${{ matrix.python-version }}
allure_history: gh-pages/allure-full-history
allure_history: allure-history/full
keep_reports: 20

# Generate Partial Run Allure Reports (pull_request)
- name: Allure report action for Partial Run
uses: simple-elf/allure-report-action@master
if: github.event_name == 'pull_request'
uses: simple-elf/allure-report-action@master
with:
allure_results: build/${{ matrix.python-version }}/allure-results
subfolder: ${{ matrix.python-version }}
allure_history: gh-pages/allure-partial-history
allure_history: allure-history/partial
keep_reports: 20

# Archive Reports
# Archive Full Reports
- name: Tar full report
if: github.event_name == 'schedule' || github.event_name == 'push'
run: tar -cvf allure_full_history_${{ matrix.python-version }}.tar gh-pages/allure-full-history/${{ matrix.python-version }}
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master'
run: tar -cvf allure_full_history_${{ matrix.python-version }}.tar allure-history/full/${{ matrix.python-version }}

# Archive Partial Reports
- name: Tar partial report
if: github.event_name == 'pull_request'
run: tar -cvf allure_partial_history_${{ matrix.python-version }}.tar gh-pages/allure-partial-history/${{ matrix.python-version }}
run: tar -cvf allure_partial_history_${{ matrix.python-version }}.tar allure-history/partial/${{ matrix.python-version }}

# Upload Report Artifacts
# Upload artifacts
- name: Upload artifact for Full Report
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
if: github.event_name == 'schedule' || github.event_name == 'push'
with:
name: allure_full_history_${{ matrix.python-version }}
path: allure_full_history_${{ matrix.python-version }}.tar

- name: Upload artifact for Partial Report
uses: actions/upload-artifact@v4
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: allure_partial_history_${{ matrix.python-version }}
path: allure_partial_history_${{ matrix.python-version }}.tar
Expand All @@ -228,86 +225,58 @@ jobs:
name: Deploy Reports
runs-on: ubuntu-latest
needs: report
if: github.ref == 'refs/heads/master'
steps:
# Download Full Artifacts (for schedule/push events)
# Download Full Artifacts (push/schedule)
- uses: actions/download-artifact@v4
name: Download Full Artifacts
if: github.event_name == 'schedule' || github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'schedule'
with:
name: allure_full_history_3.12
path: allure-history/tars/full
# Download Partial Artifacts (for pull_request events)

# Download Partial Artifacts (pull_request)
- uses: actions/download-artifact@v4
name: Download Partial Artifacts
if: github.event_name == 'pull_request'
with:
name: allure_partial_history_3.12
path: allure-history/tars/partial

# Create directories for Full and Partial reports as needed
- name: Create Full Report Directory
if: github.event_name == 'schedule' || github.event_name == 'push'
run: mkdir -p allure-history/full

- name: Create Partial Report Directory
if: github.event_name == 'pull_request'
run: mkdir -p allure-history/partial


# Create directories if needed
- name: Create Full / Partial dirs
run: |
mkdir -p allure-history/full allure-history/partial

# Untar Full Reports
- name: Untar Full Reports
if: github.event_name == 'schedule' || github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'schedule'
run: |
shopt -s nullglob
for i in allure-history/tars/full/*.tar; do
tar -xvf "$i" -C allure-history/full
done

for i in allure-history/tars/full/*.tar; do tar -xvf "$i" -C allure-history/full; done

# Untar Partial Reports
- name: Untar Partial Reports
if: github.event_name == 'pull_request'
run: |
shopt -s nullglob
for i in allure-history/tars/partial/*.tar; do
tar -xvf "$i" -C allure-history/partial
done

# Create placeholder if full directory is empty (for schedule/push)
- name: Ensure Full Directory not empty
if: github.event_name == 'schedule' || github.event_name == 'push'
run: |
if [ ! "$(ls -A allure-history/full)" ]; then
echo "No files extracted, creating a placeholder file."
touch allure-history/full/.placeholder
fi

# Create placeholder if partial directory is empty (for pull_request)
- name: Ensure Partial Directory not empty
if: github.event_name == 'pull_request'
run: |
if [ ! "$(ls -A allure-history/partial)" ]; then
echo "No files extracted, creating a placeholder file."
touch allure-history/partial/.placeholder
fi

# Remove the Tar Files
for i in allure-history/tars/partial/*.tar; do tar -xvf "$i" -C allure-history/partial; done

# Remove Tar Reports
- name: Remove Tar Reports
run: rm -rf allure-history/tars

# Deploy Full Report (for schedule/push events)
- name: Deploy Full Report
if: github.event_name == 'schedule' || github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history/full

# Deploy Partial Report (for pull_request events)
- name: Deploy Partial Report
if: github.event_name == 'pull_request'

# Ensure not empty
- name: Ensure not empty
run: |
if [ ! "$(ls -A allure-history)" ]; then
touch allure-history/.placeholder
fi

# Deploy everything to gh-pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history/partial
publish_dir: allure-history
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from uk_bin_collection.uk_bin_collection.common import *
from uk_bin_collection.uk_bin_collection.get_bin_data import AbstractGetBinDataClass


# import the wonderful Beautiful Soup and the URL grabber
class CouncilClass(AbstractGetBinDataClass):
"""
Expand Down
Loading