-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (87 loc) · 2.64 KB
/
ci.yaml
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
name: CI
on:
workflow_dispatch:
inputs:
DEB_DISTRO:
type: string
required: false
description: 'Ubuntu/Debian distro:'
default: jammy
ROS_DISTRO:
type: string
required: false
description: 'ROS distribution codename:'
default: one
push:
branches: [ main ]
paths-ignore: [ '.github/**' ]
pull_request:
branches: [ main ]
env:
DEBS_PATH: ${{ inputs.DEBS_PATH || vars.DEBS_PATH || '~/debs' }}
TERM: xterm # needed for colored output of unittests
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install shellcheck
run: sudo apt-get install shellcheck
- uses: pre-commit/[email protected]
id: precommit
- name: Upload pre-commit changes
if: failure() && steps.precommit.outcome == 'failure'
uses: rhaschke/upload-git-patch-action@main
with:
name: pre-commit
unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: ./test/bats/bin/bats --formatter pretty test/*.bats
- name: Check that *.js scripts are all identical to main.js
run: |
err=0
for f in $(find . -iname "*.js"); do
if ! diff -q $f main.js; then
echo "::warning:: $f differs from main.js"
err=1
fi
done
exit $err
ci:
runs-on: ubuntu-latest
needs: unittests
strategy:
fail-fast: false
matrix:
DEB_DISTRO: [focal, jammy, bookworm ]
ROS_DISTRO: [one]
env:
DEB_DISTRO: ${{ matrix.DEB_DISTRO }}
ROS_DISTRO: ${{ matrix.ROS_DISTRO }}
DEBUG_BASH: ${{ secrets.ACTIONS_STEP_DEBUG && 'true' || 'false' }}
# These two are needed for the flat-repo generation
DEPLOY_URL: ${{ vars.DEPLOY_URL || 'self' }}
BRANCH: ${{ matrix.DEB_DISTRO }}-${{ matrix.ROS_DISTRO }}-CI
name: minimal-${{ matrix.DEB_DISTRO }}-${{ matrix.ROS_DISTRO }}
steps:
- uses: actions/checkout@v3
- name: Run main action
uses: ./
env:
DEB_DISTRO: ${{ matrix.DEB_DISTRO }}
ROS_DISTRO: ${{ matrix.ROS_DISTRO }}
ROS_SOURCES: .github/workflows/minimal.repos
- name: Upload debs
uses: actions/upload-artifact@v3
with:
name: minimal-${{ matrix.DEB_DISTRO }}-${{ matrix.ROS_DISTRO }}
path: ${{ env.DEBS_PATH }}