Skip to content

Commit 67b17e0

Browse files
authored
Merge pull request yamcs#31 from unlikelyzero/basic-ci
Add Basic CI Checks to catch early, simple failure
2 parents 57673e1 + c482b3d commit 67b17e0

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.github/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * 0' # Runs every Sunday at midnight
8+
9+
jobs:
10+
build:
11+
name: Build and Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install dependencies
18+
run: sudo apt-get update && sudo apt-get install -y build-essential
19+
20+
- name: Run make all and wait for Sent
21+
run: make wait-for-sent
22+
23+
- name: Archive all.txt logs
24+
if: always()
25+
uses: actions/upload-artifact@v3
26+
with:
27+
path: /quickstart/docker/all.txt

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88

99
# VSCode
1010
.vscode/settings.json
11+
12+
# Docker logs for CI
13+
docker/all.log

docker/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ yamcs-simulator: yamcs-up ## run yamcs simulator
2222
yamcs-shell: ## shell into yamcs container
2323
docker compose up -d && docker compose exec yamcs bash
2424

25+
wait-for-sent: yamcs-up ## run make all and wait up to 10 minutes for "Sent:" in the output
26+
@echo "Running make all and waiting for 'Sent:' in the output..." && \
27+
nohup $(MAKE) all > all.log 2>&1 & \
28+
pid=$$!; \
29+
timeout=600; \
30+
while ! grep -q "Sent:" all.log; do \
31+
sleep 1; \
32+
timeout=$$((timeout - 1)); \
33+
if [ $$timeout -le 0 ]; then \
34+
echo "Timeout waiting for 'Sent:' in the output"; \
35+
kill $$pid; \
36+
exit 1; \
37+
fi; \
38+
done; \
39+
echo "Found 'Sent:' in the output"; \
40+
kill $$pid
41+
2542
help:
2643
@printf "\033[37m%-30s\033[0m %s\n" "#----------------------------------------------------------------------------------"
2744
@printf "\033[37m%-30s\033[0m %s\n" "# Makefile "

0 commit comments

Comments
 (0)