-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (49 loc) · 1.4 KB
/
test.yml
File metadata and controls
53 lines (49 loc) · 1.4 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
name: Tests
on:
push:
branches:
- main
workflow_call:
workflow_dispatch:
jobs:
api:
name: API Tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Podman
run: |
sudo apt-get update
sudo apt-get install -y podman oathtool
- name: Start TimescaleDB
run: |
podman run --rm -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password -e POSTGRES_USER=report timescale/timescaledb:latest-pg16
# Wait for DB to be ready
for i in {1..30}; do
podman exec timescaledb pg_isready -U report && break
sleep 1
done
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.25.7'
- name: Test with the Go CLI
run: cd api && go test ./... -coverpkg=./... -coverprofile=coverage.out -v
smoke:
name: Smoke Tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y podman buildah jq
- name: Create tunsec device
run: |
sudo ip tuntap add dev tunsec mod tun
sudo ip addr add 172.21.0.1/16 dev tunsec
sudo ip link set dev tunsec up
- name: Run smoke test
run: ./test/smoke.sh