-
Notifications
You must be signed in to change notification settings - Fork 7
121 lines (106 loc) · 3.39 KB
/
Copy pathci.yml
File metadata and controls
121 lines (106 loc) · 3.39 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
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
name: CI
on:
pull_request:
push:
branches: [main, dev]
permissions:
contents: read
jobs:
lint:
name: shellcheck + bash -n
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install shellcheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: Run shellcheck (warning severity)
run: |
find . -name '*.sh' -not -path './.git/*' -print0 \
| xargs -0 shellcheck -S warning
- name: Run bash syntax check
run: |
find . -name '*.sh' -not -path './.git/*' -print0 \
| xargs -0 -n1 bash -n
test:
name: bats
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install bats, jq, curl, python3
run: |
sudo apt-get update
sudo apt-get install -y bats jq curl python3
- name: Run bats suite
run: bats test/
installer-smoke:
name: installer smoke (${{ matrix.image }}, ${{ matrix.path }})
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
image:
- debian:13-slim
- ubuntu:24.04
path:
- bundled
- standalone
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Pin local branch ref to HEAD
env:
BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
run: |
git -C "$PWD" branch -f "$BRANCH" HEAD
- name: Run installer smoke
env:
FEED_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
IMAGE: ${{ matrix.image }}
TEST_PATH: ${{ matrix.path }}
run: |
docker run --rm \
-e AIRPLANES_FEED_REPO=file:///workspace \
-e AIRPLANES_FEED_BRANCH="$FEED_BRANCH" \
-e AIRPLANES_TEST_PATH="$TEST_PATH" \
-v "$PWD:/workspace:ro" \
"$IMAGE" \
bash /workspace/test/installer-smoke.sh
image-rootfs-smoke:
name: image rootfs smoke
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Checkout feed
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: feed
- name: Checkout image updater
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
repository: airplanes-live/airplanes-update
path: airplanes-update
- name: Run image rootfs smoke
run: |
docker run --rm \
-e AIRPLANES_FEED_DIR=/feed \
-e AIRPLANES_UPDATE_DIR=/airplanes-update \
-v "$PWD/feed:/feed:ro" \
-v "$PWD/airplanes-update:/airplanes-update:ro" \
debian:13-slim \
bash /feed/test/image-rootfs-smoke.sh