GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — opendectcell-controller/.github/workflows/ci.yml at main · openDECTcell/opendectcell-controller

Expand file tree

/

ci.yml

Copy path
View runs
More file actions
More file actions

Latest commit

 

History

History
History
183 lines (174 loc) · 7.9 KB
/

ci.yml

Copy path

File metadata and controls

183 lines (174 loc) · 7.9 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# SPDX-License-Identifier: AGPL-3.0-or-later
name: CI
# Runs on every pull request and on pushes to main; it can also be started by hand from the Actions tab.
# The same gate runs locally before every commit (CONTRIBUTING.md). Pull requests from forks get no secrets.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# a newer push to the same branch makes the older run pointless
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
GO_VERSION: "1.27.4"
GOLANGCI_LINT_VERSION: "v2.15.0"
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Install golangci-lint
run: |
v=${GOLANGCI_LINT_VERSION#v}
base=https://github.com/golangci/golangci-lint/releases/download/$GOLANGCI_LINT_VERSION
cd "$RUNNER_TEMP"
curl -fsSLO "$base/golangci-lint-$v-linux-amd64.tar.gz"
curl -fsSLO "$base/golangci-lint-$v-checksums.txt"
grep " golangci-lint-$v-linux-amd64.tar.gz\$" "golangci-lint-$v-checksums.txt" | sha256sum -c
tar xzf "golangci-lint-$v-linux-amd64.tar.gz"
echo "$RUNNER_TEMP/golangci-lint-$v-linux-amd64" >> "$GITHUB_PATH"
# cdect is linted by the test job's build (it needs the submodule and a C compiler), so it
# is left out here.
- name: Lint
run: golangci-lint run --timeout=5m $(go list -f '{{.Dir}}' ./... | grep -v /dect/cdect)
test:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:18@sha256:979bccfde35445db618c65107d27d08c6c21339d8dc3ad4c830c6633947be0e4
env:
POSTGRES_PASSWORD: ci
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 2s --health-timeout 5s --health-retries 30
env:
OPENDECTCELL_TEST_DATABASE_URL: postgres://postgres:ci@localhost:5432/postgres?sslmode=disable
CGO_ENABLED: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Licence headers
run: |
missing=$(git ls-files '*.go' '*.sql' '*.c' '*.h' '*.html' '*.css' '*.js' '*.yml' '*.yaml' Dockerfile \
| grep -v '^third_party/\|/static/vendor/' | xargs grep -L 'SPDX-License-Identifier: AGPL-3.0-or-later' || true)
if [ -n "$missing" ]; then echo "Missing SPDX header:"; echo "$missing"; exit 1; fi
- name: Test
run: |
go test -race -count=1 ./...
go test -race -count=1 -tags libopendectcell ./cmd/... ./internal/dect/...
GOEXPERIMENT=cgocheck2 go test -count=1 -tags libopendectcell ./internal/dect/...
- name: Media regression corpus
# Skipped under -race (single goroutine, ten times slower).
run: go test -count=1 -run Corpus ./internal/media/
- name: govulncheck
run: go run golang.org/x/vuln/cmd/[email protected] ./cmd/...
interop:
# SIP interop against Asterisk (AGENTS.md §7; test/asterisk/).
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Install and configure Asterisk
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq asterisk >/dev/null
sudo cp test/asterisk/*.conf /etc/asterisk/
sudo systemctl restart asterisk
for i in $(seq 30); do
sudo asterisk -rx "pjsip show transports" 2>/dev/null | grep -q transport-udp && break
sleep 1
done
sudo asterisk -rx "core show version"
sudo asterisk -rx "pjsip show endpoints"
sudo asterisk -rx "pjsip set logger on"
- name: Interop test
env:
OPENDECTCELL_INTEROP_SIP: 127.0.0.1:5060
run: go test -tags interop -count=1 -v -run Interop ./internal/sip/
- name: Asterisk state on failure
if: failure()
run: |
sudo asterisk -rx "pjsip show contacts" || true
sudo asterisk -rx "core show channels" || true
sudo tail -n 1500 /var/log/asterisk/messages* || true
sudo tail -n 1500 /var/log/asterisk/full* || true
interop-freeswitch:
# SIP interop against FreeSWITCH (AGENTS.md §7). No Ubuntu package
# exists, so a community image pinned by digest; its vanilla
# configuration provides users 1000-1019 and generates a password.
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Start FreeSWITCH 1.10.12
run: |
docker run -d --name fs --network host \
safarov/freeswitch@sha256:b31c743f4c911a19687c61e3214968f2a24f93f9d3d667cc26284192e158ffc6
ip=$(hostname -I | awk '{print $1}')
for i in $(seq 60); do
docker exec fs fs_cli -x "sofia status profile internal" 2>/dev/null | grep -q RUNNING && break
sleep 2
done
pw=$(docker logs fs 2>&1 | sed -n "s/.*password for SIP calls set to '\(.*\)'.*/\1/p" | head -1)
test -n "$pw"
echo "::add-mask::$pw"
{
echo "OPENDECTCELL_INTEROP_SIP=$ip:5060"
echo "OPENDECTCELL_INTEROP_DOMAIN=$ip"
echo "OPENDECTCELL_INTEROP_BIND=$ip"
echo "OPENDECTCELL_INTEROP_USERS=1000:$pw,1001:$pw"
} >> "$GITHUB_ENV"
docker exec fs fs_cli -x "version"
docker exec fs fs_cli -x "sofia global siptrace on"
- name: Interop test
run: go test -tags interop -count=1 -v -run Interop ./internal/sip/
- name: FreeSWITCH state on failure
if: failure()
run: |
docker exec fs fs_cli -x "sofia status profile internal reg" || true
# FreeSWITCH runs without a console (-nc): the trace is in its log file.
docker exec fs sh -c 'tail -n 3000 /var/log/freeswitch/freeswitch.log' || true
image:
# The image that would be released: the same Dockerfile and compose file, with the DECT core (LIBOPENDECTCELL=1).
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Build the image
run: |
echo "LIBOPENDECTCELL=1" >> "$GITHUB_ENV"
LIBOPENDECTCELL=1 docker compose build --build-arg VERSION=${GITHUB_SHA::7}
- name: The image has the DECT core
run: |
docker compose run --rm --no-deps --entrypoint /usr/local/bin/opendectcell-controller controller version | tee /dev/stderr | grep -q 'dect-core: yes'
- name: Compose bring-up smoke test
run: |
docker compose up -d
for i in $(seq 60); do curl -fsS http://127.0.0.1:8080/readyz && break; sleep 2; done
docker compose exec -T controller opendectcell-controller migrate status
printf 'ci admin password\n' | docker compose exec -T controller opendectcell-controller user create --username admin --role admin
curl -fsS http://127.0.0.1:8080/readyz
code=$(curl -s -o /dev/null -w '%{http_code}' -X POST \
-H 'Sec-Fetch-Site: same-origin' \
-d 'username=admin&password=ci+admin+password&next=/' http://127.0.0.1:8080/login)
test "$code" = 303
- name: Logs on failure
if: failure()
run: docker compose logs --no-color
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.