@@ -2,11 +2,15 @@ name: Test Action
22
33on :
44 push :
5+ branches :
6+ - main
57 pull_request :
8+ branches :
9+ - main
610 workflow_dispatch :
711
812jobs :
9- test :
13+ test-all-packages :
1014 runs-on : ubuntu-${{ matrix.ubuntu_version }}
1115
1216 strategy :
@@ -16,55 +20,116 @@ jobs:
1620 - ros_distro : rolling
1721 debian_distro : noble
1822 ubuntu_version : ' 24.04'
19- packages_dir : test/packages-ros2
23+ packages_dir : test
2024
2125 - ros_distro : kilted
2226 debian_distro : noble
2327 ubuntu_version : ' 24.04'
24- packages_dir : test/packages-ros2
28+ packages_dir : test
2529
2630 - ros_distro : jazzy
2731 debian_distro : noble
2832 ubuntu_version : ' 24.04'
29- packages_dir : test/packages-ros2
33+ packages_dir : test
3034
3135 - ros_distro : humble
3236 debian_distro : jammy
3337 ubuntu_version : ' 22.04'
34- packages_dir : test/packages-ros2
38+ packages_dir : test
3539
3640 steps :
3741 - name : Checkout Repository
3842 uses : actions/checkout@v4
3943
40- - name : Test ${{ matrix.ros_distro }} packages
44+ - name : Test ${{ matrix.ros_distro }} - All packages
4145 uses : ./
4246 with :
4347 ros_distro : ${{ matrix.ros_distro }}
4448 debian_distro : ${{ matrix.debian_distro }}
4549 packages_dir : ${{ matrix.packages_dir }}
4650
47- - name : Verify git info not in .deb files
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+
65+ - name : Verify only package_a and package_b built
4866 shell : bash
4967 run : |
50- echo "Checking if git config appears in generated .deb files..."
68+ echo "Checking generated packages..."
69+ ls -la ./bloom-build/output/
5170
52- for deb in ./bloom-build/output/*.deb; do
53- echo "=== Inspecting $(basename "$deb") ==="
71+ # Should have package_a and package_b
72+ test -f ./bloom-build/output/ros-humble-package-a*.deb || (echo "Missing package_a" && exit 1)
73+ test -f ./bloom-build/output/ros-humble-package-b*.deb || (echo "Missing package_b" && exit 1)
5474
55- # Extract control file
56- dpkg-deb --info "$deb"
75+ # Should NOT have package_c, package_d, or package_test
76+ ! ls ./bloom-build/output/ros-humble-package-c*.deb 2>/dev/null && echo "✓ No package_c (correct)"
77+ ! ls ./bloom-build/output/ros-humble-package-d*.deb 2>/dev/null && echo "✓ No package_d (correct)"
78+ ! ls ./bloom-build/output/ros-humble-package-test*.deb 2>/dev/null && echo "✓ No package_test (correct)"
5779
58- # Extract and search all files for git config values
59- mkdir -p /tmp/deb-inspect
60- dpkg-deb -x "$deb" /tmp/deb-inspect
80+ test-blacklist :
81+ runs-on : ubuntu-22.04
82+ steps :
83+ - name : Checkout Repository
84+ uses : actions/checkout@v4
6185
62- echo "Searching for 'Bloom Release Bot'..."
63- grep -r "Bloom Release Bot" /tmp/deb-inspect || echo " ✓ Not found"
86+ - name : Test blacklist - Exclude *_test packages
87+ uses : ./
88+ with :
89+ ros_distro : humble
90+ debian_distro : jammy
91+ packages_dir : test
92+ package_blacklist : ' .*_test$'
93+
94+ - name : Verify package_test was excluded
95+ shell : bash
96+ run : |
97+ echo "Checking generated packages..."
98+ ls -la ./bloom-build/output/
99+
100+ # Should NOT have package_test
101+ ! ls ./bloom-build/output/ros-humble-package-test*.deb 2>/dev/null && echo "✓ package_test excluded (correct)"
102+
103+ # Should have other packages
104+ test -f ./bloom-build/output/ros-humble-package-a*.deb || (echo "Missing package_a" && exit 1)
105+ test -f ./bloom-build/output/ros-humble-package-c*.deb || (echo "Missing package_c" && exit 1)
106+
107+ test-whitelist-and-blacklist :
108+ runs-on : ubuntu-22.04
109+ steps :
110+ - name : Checkout Repository
111+ uses : actions/checkout@v4
112+
113+ - name : Test combined whitelist and blacklist
114+ uses : ./
115+ with :
116+ ros_distro : humble
117+ debian_distro : jammy
118+ packages_dir : test
119+ package_whitelist : ' ^.*/package_[abc]$'
120+ package_blacklist : ' ^.*/package_c$'
121+
122+ - name : Verify correct filtering
123+ shell : bash
124+ run : |
125+ echo "Checking generated packages..."
126+ ls -la ./bloom-build/output/
64127
65- echo "Searching for 'bloom@github-actions'..."
66- grep -r "bloom@github-actions" /tmp/deb-inspect || echo " ✓ Not found"
128+ # Should have package_a and package_b
129+ test -f ./bloom-build/output/ros-humble-package-a*.deb || (echo "Missing package_a" && exit 1)
130+ test -f ./bloom-build/output/ros-humble-package-b*.deb || (echo "Missing package_b" && exit 1)
67131
68- rm -rf /tmp/deb-inspect
69- echo ""
70- done
132+ # Should NOT have package_c, package_d, or package_test
133+ ! ls ./bloom-build/output/ros-humble-package-c*.deb 2>/dev/null && echo "✓ No package_c (correct)"
134+ ! ls ./bloom-build/output/ros-humble-package-d*.deb 2>/dev/null && echo "✓ No package_d (correct)"
135+ ! ls ./bloom-build/output/ros-humble-package-test*.deb 2>/dev/null && echo "✓ No package_test (correct)"
0 commit comments