-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (61 loc) · 2.3 KB
/
ci.yml
File metadata and controls
73 lines (61 loc) · 2.3 KB
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
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
repository_dispatch:
types: [ros2_medkit_updated]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for trailing whitespace
run: |
! git grep -I --line-number --perl-regexp '\s+$' -- \
'*.md' '*.py' '*.yaml' '*.yml' || \
(echo "Found trailing whitespace in the files above" && exit 1)
- name: Check shell scripts with shellcheck
run: |
sudo apt-get update && sudo apt-get install -y shellcheck
find . \( -name "*.sh" -o -name "*.bash" \) -type f | xargs shellcheck
- name: Validate YAML files
run: |
sudo apt-get update && sudo apt-get install -y yamllint
YAMLLINT_CONFIG="{extends: relaxed, rules: {line-length: {max: 120}}}"
find . \( -name "*.yaml" -o -name "*.yml" \) -type f | xargs yamllint -d "$YAMLLINT_CONFIG"
docker-build:
runs-on: ubuntu-24.04
steps:
- name: Show triggering source
if: github.event_name == 'repository_dispatch'
run: |
SHA="${{ github.event.client_payload.sha }}"
RUN_URL="${{ github.event.client_payload.run_url }}"
echo "## Triggered by ros2_medkit" >> "$GITHUB_STEP_SUMMARY"
echo "- Commit: \`${SHA:-unknown}\`" >> "$GITHUB_STEP_SUMMARY"
if [ -n "$RUN_URL" ]; then
echo "- Run: [View triggering run]($RUN_URL)" >> "$GITHUB_STEP_SUMMARY"
else
echo "- Run: (URL not provided)" >> "$GITHUB_STEP_SUMMARY"
fi
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Sensor Diagnostics demo image
run: |
cd demos/sensor_diagnostics
docker build -t sensor-diagnostics-demo:test -f Dockerfile .
- name: Build TurtleBot3 demo image
run: |
cd demos/turtlebot3_integration
docker build -t turtlebot3-medkit-demo:test -f Dockerfile .
- name: Build MoveIt Pick-and-Place demo image
run: |
cd demos/moveit_pick_place
docker build -t moveit-pick-place-demo:test -f Dockerfile .