-
Notifications
You must be signed in to change notification settings - Fork 3
132 lines (129 loc) · 4.74 KB
/
check-samples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Check samples
# avoiding duplicate jobs on push with open pull_request: https://github.com/orgs/community/discussions/26940#discussioncomment-6656489
on: [push, pull_request]
jobs:
check:
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)
runs-on: ubuntu-latest
strategy:
matrix:
include:
- package_name: ros2_cpp_pkg
template: ros2_cpp_pkg
node_name: ros2_cpp_node
is_component: false
is_lifecycle: false
has_launch_file: true
has_params: true
has_subscriber: true
has_publisher: true
has_service_server: false
has_action_server: false
has_timer: false
has_docker_ros: true
- package_name: ros2_cpp_component_pkg
template: ros2_cpp_pkg
node_name: ros2_cpp_node
is_component: true
is_lifecycle: false
has_launch_file: true
has_params: true
has_subscriber: true
has_publisher: true
has_service_server: false
has_action_server: false
has_timer: false
has_docker_ros: true
- package_name: ros2_cpp_lifecycle_pkg
template: ros2_cpp_pkg
node_name: ros2_cpp_node
is_component: false
is_lifecycle: true
has_launch_file: true
has_params: true
has_subscriber: true
has_publisher: true
has_service_server: false
has_action_server: false
has_timer: false
has_docker_ros: true
- package_name: ros2_cpp_all_pkg
template: ros2_cpp_pkg
node_name: ros2_cpp_node
is_component: true
is_lifecycle: true
has_launch_file: true
has_params: true
has_subscriber: true
has_publisher: true
has_service_server: true
has_action_server: true
has_timer: true
has_docker_ros: true
- package_name: ros2_python_pkg
template: ros2_python_pkg
node_name: ros2_python_node
is_lifecycle: false
has_launch_file: true
has_params: true
has_subscriber: true
has_publisher: true
has_service_server: false
has_action_server: false
has_timer: false
has_docker_ros: true
- package_name: ros2_python_all_pkg
template: ros2_python_pkg
node_name: ros2_python_node
is_lifecycle: false
has_launch_file: true
has_params: true
has_subscriber: true
has_publisher: true
has_service_server: true
has_action_server: true
has_timer: true
has_docker_ros: true
- package_name: ros2_interfaces_pkg
template: ros2_interfaces_pkg
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install "copier~=9.2.0" "jinja2-strcase~=0.0.2"
- name: Configure git to run copier
run: |
git config --global user.name "dummy"
git config --global user.email "[email protected]"
- name: Generate packages
run: |
copier copy --trust --defaults \
-d template=${{ matrix.template }} \
-d package_name=${{ matrix.package_name }} \
-d node_name=${{ matrix.node_name }} \
-d is_component=${{ matrix.is_component }} \
-d is_lifecycle=${{ matrix.is_lifecycle }} \
-d has_launch_file=${{ matrix.has_launch_file }} \
-d has_params=${{ matrix.has_params }} \
-d has_subscriber=${{ matrix.has_subscriber }} \
-d has_publisher=${{ matrix.has_publisher }} \
-d has_service_server=${{ matrix.has_service_server }} \
-d has_action_server=${{ matrix.has_action_server }} \
-d has_timer=${{ matrix.has_timer }} \
-d has_docker_ros=${{ matrix.has_docker_ros }} \
. packages
- name: Check for repository changes
run: |
rm -rf samples/${{ matrix.package_name }}*
mv packages/${{ matrix.package_name }}* samples/
if [[ ! -z "$(git status --porcelain)" ]]; then
echo "Sample generation resulted in changes to the repository"
git status
git diff
exit 1
fi