Skip to content

Commit 61ae577

Browse files
authored
Merge pull request #1 from WATonomous/eddy/add_bloom_workflow
Implement basic bloom release workflow
2 parents dd857cf + a772c66 commit 61ae577

File tree

18 files changed

+1030
-0
lines changed

18 files changed

+1030
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Pre-commit
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
run-pre-commit:
11+
name: Pre-commit Check
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install pre-commit
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pre-commit
25+
26+
- name: Run pre-commit hooks
27+
run: pre-commit run --all-files

.github/workflows/test.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Test Action
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
test-all-packages:
14+
runs-on: ubuntu-${{ matrix.ubuntu_version }}
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- ros_distro: rolling
21+
debian_distro: noble
22+
ubuntu_version: '24.04'
23+
packages_dir: test
24+
25+
- ros_distro: kilted
26+
debian_distro: noble
27+
ubuntu_version: '24.04'
28+
packages_dir: test
29+
30+
- ros_distro: jazzy
31+
debian_distro: noble
32+
ubuntu_version: '24.04'
33+
packages_dir: test
34+
35+
- ros_distro: humble
36+
debian_distro: jammy
37+
ubuntu_version: '22.04'
38+
packages_dir: test
39+
40+
steps:
41+
- name: Checkout Repository
42+
uses: actions/checkout@v4
43+
44+
- name: Test ${{ matrix.ros_distro }} - All packages
45+
uses: ./
46+
with:
47+
ros_distro: ${{ matrix.ros_distro }}
48+
debian_distro: ${{ matrix.debian_distro }}
49+
packages_dir: ${{ matrix.packages_dir }}
50+
51+
test-whitelist:
52+
runs-on: ubuntu-22.04
53+
steps:
54+
- name: Checkout Repository
55+
uses: actions/checkout@v4
56+
57+
- name: Test whitelist - Only package_a and package_b
58+
uses: ./
59+
with:
60+
ros_distro: humble
61+
debian_distro: jammy
62+
packages_dir: test
63+
package_whitelist: '^.*/package_[ab]$'
64+
artifact_name: bloom-test-whitelist
65+
66+
- name: Verify only package_a and package_b built
67+
shell: bash
68+
run: |
69+
echo "Checking generated packages..."
70+
ls -la ./bloom-build/output/
71+
72+
# Should have package_a and package_b
73+
test -f ./bloom-build/output/ros-humble-package-a*.deb || (echo "Missing package_a" && exit 1)
74+
test -f ./bloom-build/output/ros-humble-package-b*.deb || (echo "Missing package_b" && exit 1)
75+
76+
# Should NOT have package_c, package_d, or package_test
77+
! ls ./bloom-build/output/ros-humble-package-c*.deb 2>/dev/null && echo "✓ No package_c (correct)"
78+
! ls ./bloom-build/output/ros-humble-package-d*.deb 2>/dev/null && echo "✓ No package_d (correct)"
79+
! ls ./bloom-build/output/ros-humble-package-test*.deb 2>/dev/null && echo "✓ No package_test (correct)"
80+
81+
test-blacklist:
82+
runs-on: ubuntu-22.04
83+
steps:
84+
- name: Checkout Repository
85+
uses: actions/checkout@v4
86+
87+
- name: Test blacklist - Exclude *_test packages
88+
uses: ./
89+
with:
90+
ros_distro: humble
91+
debian_distro: jammy
92+
packages_dir: test
93+
package_blacklist: '.*_test$'
94+
artifact_name: bloom-test-blacklist
95+
96+
- name: Verify package_test was excluded
97+
shell: bash
98+
run: |
99+
echo "Checking generated packages..."
100+
ls -la ./bloom-build/output/
101+
102+
# Should NOT have package_test
103+
! ls ./bloom-build/output/ros-humble-package-test*.deb 2>/dev/null && echo "✓ package_test excluded (correct)"
104+
105+
# Should have other packages
106+
test -f ./bloom-build/output/ros-humble-package-a*.deb || (echo "Missing package_a" && exit 1)
107+
test -f ./bloom-build/output/ros-humble-package-c*.deb || (echo "Missing package_c" && exit 1)
108+
109+
test-whitelist-and-blacklist:
110+
runs-on: ubuntu-22.04
111+
steps:
112+
- name: Checkout Repository
113+
uses: actions/checkout@v4
114+
115+
- name: Test combined whitelist and blacklist
116+
uses: ./
117+
with:
118+
ros_distro: humble
119+
debian_distro: jammy
120+
packages_dir: test
121+
package_whitelist: '^.*/package_[abc]$'
122+
package_blacklist: '^.*/package_c$'
123+
artifact_name: bloom-test-whitelist-blacklist
124+
125+
- name: Verify correct filtering
126+
shell: bash
127+
run: |
128+
echo "Checking generated packages..."
129+
ls -la ./bloom-build/output/
130+
131+
# Should have package_a and package_b
132+
test -f ./bloom-build/output/ros-humble-package-a*.deb || (echo "Missing package_a" && exit 1)
133+
test -f ./bloom-build/output/ros-humble-package-b*.deb || (echo "Missing package_b" && exit 1)
134+
135+
# Should NOT have package_c, package_d, or package_test
136+
! ls ./bloom-build/output/ros-humble-package-c*.deb 2>/dev/null && echo "✓ No package_c (correct)"
137+
! ls ./bloom-build/output/ros-humble-package-d*.deb 2>/dev/null && echo "✓ No package_d (correct)"
138+
! ls ./bloom-build/output/ros-humble-package-test*.deb 2>/dev/null && echo "✓ No package_test (correct)"

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Build artifacts
2+
*.deb
3+
*.ddeb
4+
*.changes
5+
*.dsc
6+
*.tar.gz
7+
*.buildinfo
8+
9+
# IDE
10+
.vscode/
11+
.idea/
12+
*.swp
13+
*.swo
14+
*~
15+
16+
# OS
17+
.DS_Store
18+
Thumbs.db

.pre-commit-config.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
repos:
3+
# General-purpose sanity checks
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: check-added-large-files
8+
- id: check-case-conflict
9+
- id: check-merge-conflict
10+
- id: check-shebang-scripts-are-executable
11+
- id: check-symlinks
12+
- id: check-xml
13+
- id: end-of-file-fixer
14+
- id: mixed-line-ending
15+
- id: trailing-whitespace
16+
- id: check-yaml
17+
18+
# Bash / Shell scripts
19+
- repo: https://github.com/shellcheck-py/shellcheck-py
20+
rev: v0.10.0.1
21+
hooks:
22+
- id: shellcheck
23+
24+
# Markdown linting
25+
- repo: https://github.com/jackdewinter/pymarkdown
26+
rev: v0.9.28
27+
hooks:
28+
- id: pymarkdown
29+
args: [-d, MD013, scan]
30+
31+
# YAML linting
32+
- repo: https://github.com/adrienverge/yamllint.git
33+
rev: v1.35.1
34+
hooks:
35+
- id: yamllint
36+
args: [-d, '{extends: default, rules: {line-length: {max: 120}, document-start: disable}}']

0 commit comments

Comments
 (0)