Skip to content

Commit

Permalink
Merge branch 'robbrad:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
m26dvd authored Jan 28, 2025
2 parents a827749 + 50b01ea commit 25348c3
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 35 deletions.
72 changes: 56 additions & 16 deletions .github/workflows/behave_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,35 +191,75 @@ jobs:
name: allure_partial_history_${{ matrix.python-version }}
path: allure_partial_history_${{ matrix.python-version }}.tar

# Deploy only on schedule + master branch
deploy:
name: Deploy Reports
runs-on: ubuntu-latest
permissions:
contents: write

needs: report
steps:
# Checkout the repository to work with the git history
- name: Checkout repository
uses: actions/checkout@v4

# Download Full Artifacts
- uses: actions/download-artifact@v4
name: Download Full Artifacts
with:
name: allure_partial_history_3.12
path: allure-history/tars

- name: Untar reports
run: for i in allure-history/tars/*.tar; do tar -xvf "$i" allure-history-partial ;done


- name: Display structure of downloaded files
run: ls -R

- name: Display directory
run: pwd

# Untar reports into a temporary directory
- name: Untar reports to temporary directory
run: |
mkdir -p temp_extracted # Create a temporary directory for untarring
for i in allure-history/tars/*.tar; do
tar -xvf "$i" -C temp_extracted # Untar into the temporary directory
done
# Move the files from the correct location and delete unnecessary folders
- name: Move files to the correct location
run: |
mkdir -p 3.12/partial # Ensure the target directory exists
mv temp_extracted/allure-history-partial/3.12/partial/* 3.12/partial/ # Move files to the target directory
rm -rf temp_extracted # Clean up the temporary extraction folder
# Remove the tar reports
- name: Remove tar reports
run: rm -rf allure-history/tars

- name: Display structure of downloaded files

# Display structure after untarring and moving
- name: Display structure of moved files
run: ls -R

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.GH_PAGES_TOKEN }}
publish_branch: gh-pages
publish_dir: ./allure-history-partial
keep_files: true

# Set up Git for pushing changes
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Authenticate using the personal access token (GH_PAGES_TOKEN)
- name: Authenticate with GH_PAGES_TOKEN
run: |
git remote set-url origin https://x-access-token:${{ secrets.GH_PAGES_TOKEN }}@github.com/${{ github.repository }}.git
# Pull the latest changes from gh-pages and switch to the gh-pages branch
- name: Pull latest changes from gh-pages
run: |
git fetch origin
git checkout gh-pages
git pull origin gh-pages
# Commit and push changes to gh-pages
- name: Commit and push changes to gh-pages
run: |
git add .
git commit -m "Deploy reports to gh-pages"
git push origin gh-pages
71 changes: 56 additions & 15 deletions .github/workflows/behave_schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,29 +182,70 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write

needs: report
steps:
# Checkout the repository to work with the git history
- name: Checkout repository
uses: actions/checkout@v4

# Download Full Artifacts
- uses: actions/download-artifact@v4
name: Download Full Artifacts
with:
name: allure_full_history_3.12
path: allure-history/tars

- name: Untar reports
run: for i in allure-history/tars/*.tar; do tar -xvf "$i" allure-history-full ;done


- name: Display structure of downloaded files
run: ls -R

- name: Display directory
run: pwd

# Untar reports into a temporary directory
- name: Untar reports to temporary directory
run: |
mkdir -p temp_extracted # Create a temporary directory for untarring
for i in allure-history/tars/*.tar; do
tar -xvf "$i" -C temp_extracted # Untar into the temporary directory
done
# Move the files from the correct location and delete unnecessary folders
- name: Move files to the correct location
run: |
mkdir -p 3.12/full # Ensure the target directory exists
mv temp_extracted/allure-history-full/3.12/full/* 3.12/full/ # Move files to the target directory
rm -rf temp_extracted # Clean up the temporary extraction folder
# Remove the tar reports
- name: Remove tar reports
run: rm -rf allure-history/tars

- name: Display structure of downloaded files

# Display structure after untarring and moving
- name: Display structure of moved files
run: ls -R

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.GH_PAGES_TOKEN }}
publish_branch: gh-pages
publish_dir: ./allure-history-full
keep_files: true

# Set up Git for pushing changes
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Authenticate using the personal access token (GH_PAGES_TOKEN)
- name: Authenticate with GH_PAGES_TOKEN
run: |
git remote set-url origin https://x-access-token:${{ secrets.GH_PAGES_TOKEN }}@github.com/${{ github.repository }}.git
# Pull the latest changes from gh-pages and switch to the gh-pages branch
- name: Pull latest changes from gh-pages
run: |
git fetch origin
git checkout gh-pages
git pull origin gh-pages
# Commit and push changes to gh-pages
- name: Commit and push changes to gh-pages
run: |
git add .
git commit -m "Deploy reports to gh-pages"
git push origin gh-pages
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
=======
## 0.128.4 (2025-01-28)

### Fix

- Update CheshireEastCouncil.py
- Update behave_schedule.yml
- Update behave_pull_request.yml
- Update behave_pull_request.yml
- Update behave_pull_request.yml
- Update behave_pull_request.yml
- Update behave_pull_request.yml
- Update behave_schedule.yml
- Update CheshireEastCouncil.py
- Update behave_schedule.yml
- Update behave_pull_request.yml

## 0.128.3 (2025-01-28)

### Fix
Expand Down
2 changes: 1 addition & 1 deletion custom_components/uk_bin_collection/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ async def async_step_reconfigure_confirm(

async def get_councils_json(self) -> Dict[str, Any]:
"""Fetch and return the supported councils data."""
url = "https://raw.githubusercontent.com/robbrad/UKBinCollectionData/0.128.3/uk_bin_collection/tests/input.json"
url = "https://raw.githubusercontent.com/robbrad/UKBinCollectionData/0.128.4/uk_bin_collection/tests/input.json"
try:
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/uk_bin_collection/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/robbrad/UKBinCollectionData/issues",
"requirements": ["uk-bin-collection>=0.128.3"],
"version": "0.128.3",
"requirements": ["uk-bin-collection>=0.128.4"],
"version": "0.128.4",
"zeroconf": []
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "uk_bin_collection"
version = "0.128.3"
version = "0.128.4"
description = "Python Lib to collect UK Bin Data"
readme = "README.md"
authors = ["Robert Bradley <robbrad182@gmail.com>"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CouncilClass(AbstractGetBinDataClass):
"""
A class to fetch and parse bin collection data for Cheshire East Council.
"""

def parse_data(self, page: Any, **kwargs: Any) -> Dict[str, Any]:
soup = BeautifulSoup(page.text, features="html.parser")

Expand All @@ -18,6 +19,7 @@ def parse_data(self, page: Any, **kwargs: Any) -> Dict[str, Any]:
table: Optional[Tag | NavigableString] = soup.find(
"table", {"class": "job-details"}
)

if isinstance(table, Tag): # Ensure we only proceed if 'table' is a Tag
rows = table.find_all("tr", {"class": "data-row"})

Expand Down

0 comments on commit 25348c3

Please sign in to comment.