diff --git a/.github/workflows/behave.yml b/.github/workflows/behave.yml index 03d6a73354..d3ebb6a7d9 100644 --- a/.github/workflows/behave.yml +++ b/.github/workflows/behave.yml @@ -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 @@ -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 diff --git a/uk_bin_collection/uk_bin_collection/councils/AberdeenCityCouncil.py b/uk_bin_collection/uk_bin_collection/councils/AberdeenCityCouncil.py index a69b3ab16b..00ed29fe59 100644 --- a/uk_bin_collection/uk_bin_collection/councils/AberdeenCityCouncil.py +++ b/uk_bin_collection/uk_bin_collection/councils/AberdeenCityCouncil.py @@ -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): """