Skip to content

Commit

Permalink
build: use official Black GHA & fix continuous workflow (#168)
Browse files Browse the repository at this point in the history
* build: use official Black GHA

* build: remove old black formatter.

* build: fixup continuous workflow?

* REMOVE: trigger on all branches.

* build: no need for composite actions

* Revert "build: no need for composite actions"

This reverts commit 4ef6824.

* build: shell = bash.

* build: no need for shell there.

* refactor: apply black formatting.

* build: only run continuous workflow on main.

* build: separate jobs

* REMOVE: trigger on PR

* build: fix syntax

* Revert "REMOVE: trigger on PR"

This reverts commit 60ab338.
  • Loading branch information
jws-1 authored Apr 26, 2024
1 parent 35d88bd commit 21949a1
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 30 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Pull Request
name: Continuous

on:
push:
branches:
- [main]
- 'main'
jobs:
QC:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository and Submodules
uses: actions/checkout@v4
- name: Build & Deploy Documentation
uses: "./.github/workflows/docs"
- name: Quality Control
uses: "./.github/workflows/qc"
Documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository and Submodules
uses: actions/checkout@v4
- name: Build & Deploy Documentation
uses: "./.github/workflows/docs"
3 changes: 3 additions & 0 deletions .github/workflows/docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ runs:
steps:

- name: Install ROS Noetic
shell: bash
run: |
sudo add-apt-repository universe
sudo add-apt-repository restricted
Expand All @@ -21,6 +22,7 @@ runs:
sudo apt install ros-noetic-ros-base python3-catkin-tools
- name: Build documentation package
shell: bash
run: |
source /opt/ros/noetic/setup.bash
catkin build documentation
Expand All @@ -31,6 +33,7 @@ runs:
node-version: 20

- name: Build documentation
shell: bash
run: |
source /opt/ros/noetic/setup.bash
source devel/setup.bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/qc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ runs:
steps:

- name: Python Formatting
uses: rickstaa/action-black@v1
uses: psf/black@stable
with:
black_args: ". --check --diff"
options: "--check --verbose"
jupyter: true
version: "24.3.0"
24 changes: 12 additions & 12 deletions documentation/src/document_lasr/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,18 @@ def split_depend(input: str) -> (str, str):
data["dependencies"] = DEPENDENCIES

# Load additional markdown files
data[
"prerequisites"
] = "Ask the package maintainer to write or create a blank `doc/PREREQUISITES.md` for their package!"
data[
"usage"
] = "Ask the package maintainer to write a `doc/USAGE.md` for their package!"
data[
"example"
] = "Ask the package maintainer to write a `doc/EXAMPLE.md` for their package!"
data[
"technical"
] = "Ask the package maintainer to write a `doc/TECHNICAL.md` for their package!"
data["prerequisites"] = (
"Ask the package maintainer to write or create a blank `doc/PREREQUISITES.md` for their package!"
)
data["usage"] = (
"Ask the package maintainer to write a `doc/USAGE.md` for their package!"
)
data["example"] = (
"Ask the package maintainer to write a `doc/EXAMPLE.md` for their package!"
)
data["technical"] = (
"Ask the package maintainer to write a `doc/TECHNICAL.md` for their package!"
)

for key, file in [
("prerequisites", "PREREQUISITES"),
Expand Down
6 changes: 3 additions & 3 deletions legacy/read_pcl_info/src/read_pcl_info/pcl_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def filter_laser_scan(laser_scan):
len(laser_scan.ranges) // 3 : 2 * len(laser_scan.ranges) // 3
]
filtered_ranges = [np.nan] * len(laser_scan.ranges)
filtered_ranges[
len(laser_scan.ranges) // 3 : 2 * len(laser_scan.ranges) // 3
] = middle_part
filtered_ranges[len(laser_scan.ranges) // 3 : 2 * len(laser_scan.ranges) // 3] = (
middle_part
)
mean_distance = np.nanmean(filtered_ranges)

return mean_distance, filtered_ranges
Expand Down
18 changes: 9 additions & 9 deletions tasks/gpsr/src/gpsr/states/talk.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def __init__(self, talk_phrase: str):

def _create_responses(self) -> Dict[str, str]:
response = {}
response[
"something about yourself"
] = "I am a Tiago -- a helpful assistive robot developed by PAL Robotics."
response["something about yourself"] = (
"I am a Tiago -- a helpful assistive robot developed by PAL Robotics."
)
current_time = time.strftime("%H:%M")
response["the time"] = f"The current time is {current_time}."
current_day = time.strftime("%A")
Expand All @@ -29,16 +29,16 @@ def _create_responses(self) -> Dict[str, str]:
response["what day is tomorrow"] = f"Tomorrow is {tomorrow}."
response["your teams name"] = "Our team is called LASR."
response["your teams country"] = "Our team is from the United Kingdom."
response[
"your teams affiliation"
] = "Our team is affiliated with King's College London."
response["your teams affiliation"] = (
"Our team is affiliated with King's College London."
)
day_of_the_week = current_day
day_of_the_month = time.strftime("%d")
response["the day of the week"] = f"Today is {day_of_the_week}."

response[
"the day of the month"
] = f"The day of the month is {day_of_the_month}."
response["the day of the month"] = (
f"The day of the month is {day_of_the_month}."
)
return response

def execute(self, userdata):
Expand Down

0 comments on commit 21949a1

Please sign in to comment.