Skip to content

Commit 9baf36d

Browse files
committed
CICD: Add Check for Changes in the Supported Dive Computer Lists.
Add a check that will fail whenever there is a change in the list of supported dive computers in libdivecomputer that is not reflected in the `SupportedDivecomputers.*` lists. Also add a script for a simplified update of these lists. From a discussion with @dirkhh in subsurface/libdc#71 (comment). Signed-off-by: Michael Keller <[email protected]>
1 parent 9391547 commit 9baf36d

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

Diff for: .github/workflows/check-divecomputer-lists.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check the Supported Dive Computer Lists
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- libdivdcomputer/src/descriptor.c
9+
- SupportedDivecomputers.txt
10+
- SupportedDivecomputers.html
11+
- scripts
12+
pull_request:
13+
branches:
14+
- master
15+
paths:
16+
- libdivdcomputer/src/descriptor.c
17+
- SupportedDivecomputers.txt
18+
- SupportedDivecomputers.html
19+
- scripts
20+
21+
jobs:
22+
check:
23+
runs-on: ubuntu-24.04
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Check the Supported Dive Computer Lists
29+
run: |
30+
perl scripts/parse-descriptor.pl SupportedDivecomputers_new.txt
31+
diff -u SupportedDivecomputers.txt SupportedDivecomputers_new.txt
32+
TXT_EXIT_CODE=$?
33+
34+
perl scripts/parse-descriptor.pl SupportedDivecomputers_new.html
35+
diff -u SupportedDivecomputers.html SupportedDivecomputers_new.html
36+
37+
if [ $? -ne 0 -o $TXT_EXIT_CODE -ne 0 ] ; then
38+
echo "The list of supported dive computers in libdivecomputer has changed. Please run `scripts/update-supported-divecomputer-lists.sh` and commit the resulting changes."
39+
exit 1
40+
fi

Diff for: scripts/update-supported-divecomputer-lists.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
#
4+
# Update the Lists of Supported Dive Computers Based
5+
# on the Information in the libdivecomputer Source Code
6+
#
7+
8+
CONTAINER_NAME=subsurface-android-builder
9+
10+
pushd . &> /dev/null
11+
cd "$(dirname "$0")/.."
12+
13+
perl scripts/parse-descriptor.pl SupportedDivecomputers.html
14+
perl scripts/parse-descriptor.pl SupportedDivecomputers.txt
15+
16+
popd &> /dev/null

0 commit comments

Comments
 (0)