-
Notifications
You must be signed in to change notification settings - Fork 7
146 lines (121 loc) · 4.17 KB
/
test.yml
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
on: [push, pull_request]
name: Test
jobs:
test:
strategy:
fail-fast: false
matrix:
go-version: [1.21.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Test
run: go test ./...
build-packages:
strategy:
fail-fast: false
matrix:
go-version: [1.21.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --skip=publish --snapshot
- name: List build result
run: |
tree
- name: Upload amd64 DEB
uses: actions/upload-artifact@v4
with:
name: amd64-deb
path: dist/xrootd-monitoring-shoveler*amd64.deb
- name: Upload x86_64 RPM
uses: actions/upload-artifact@v4
with:
name: x86_64-rpm
path: dist/xrootd-monitoring-shoveler*x86_64.rpm
test-packages:
needs: [ build-packages ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os-container: ["debian:oldstable","debian:stable","debian:testing","debian:unstable","rockylinux:8","rockylinux:9"]
steps:
- name: Download amd64 DEB
if: ${{ startsWith(matrix.os-container, 'debian:') }}
uses: actions/download-artifact@v4
with:
name: amd64-deb
- name: Download x86_64 RPM
if: ${{ startsWith(matrix.os-container, 'rockylinux:') }}
uses: actions/download-artifact@v4
with:
name: x86_64-rpm
- name: List packages
run: |
tree
- name: Start Debian container
if: ${{ startsWith(matrix.os-container, 'debian:') }}
run: podman run --privileged --detach --name pkgtest --ipc=host -v ${RUNNER_WORKSPACE}:/root ${{ matrix.os-container }} bash -c "apt-get update && apt-get -y install systemd-sysv && /sbin/init"
- name: Start RockyLinux container
if: ${{ startsWith(matrix.os-container, 'rockylinux:') }}
run: |
podman run --privileged --detach --name pkgtest --ipc=host -v ${RUNNER_WORKSPACE}:/root ${{ matrix.os-container }} bash -c "dnf -y install systemd && /usr/sbin/init"
- name: Wait until container is ready
run: |
while ! $(podman top pkgtest | grep -q journald); do
sleep 1
done
- name: Install package on Debian
if: ${{ startsWith(matrix.os-container, 'debian:') }}
run: |
podman exec pkgtest bash -c "dpkg -i /root/xrootd-monitoring-shoveler/xrootd-monitoring-shoveler*amd64.deb"
- name: Install package on RockyLinux
if: ${{ startsWith(matrix.os-container, 'rockylinux:') }}
run: |
podman exec pkgtest bash -c "dnf -y install /root/xrootd-monitoring-shoveler/xrootd-monitoring-shoveler*x86_64.rpm"
- name: Check user/group, permissions on queue directory
run: |
podman exec pkgtest bash -c "getent passwd xrootd-monitoring-shoveler"
podman exec pkgtest bash -c "ls -la /var/spool/"
- name: Test createtoken command
run: |
podman exec pkgtest createtoken --help
- name: Create basic config file
shell: bash
run: |
cat > ${RUNNER_WORKSPACE}/basic-config.yaml <<EOF
mq: stomp
listen:
port: 9993
ip: 0.0.0.0
verify: true
metrics:
enable: true
port: 8000
queue_directory: /var/spool/xrootd-monitoring-shoveler/queue
EOF
podman exec pkgtest cp /root/basic-config.yaml /etc/xrootd-monitoring-shoveler/config.yaml
- name: Test shoveler service
run: |
podman exec pkgtest systemctl --full --lines=100 start xrootd-monitoring-shoveler
podman exec pkgtest systemctl --full --lines=100 status xrootd-monitoring-shoveler
- name: Test shoveler-status
run: |
podman exec pkgtest shoveler-status