Skip to content

Commit 46e5a1f

Browse files
committed
Convert VoIPTests into a reusable forkflow and run it for both
debian and ubuntu.
1 parent 408db35 commit 46e5a1f

File tree

2 files changed

+89
-64
lines changed

2 files changed

+89
-64
lines changed

.github/workflows/.voiptests.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: VoIPTests in Docker
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
rtpp-image:
7+
required: false
8+
type: string
9+
default: 'sippylabs/rtpproxy'
10+
rtpp-image-tag:
11+
required: false
12+
type: string
13+
default: 'latest-debian_13-slim'
14+
15+
jobs:
16+
set_env:
17+
name: List Supported Arches
18+
uses: sippy/cimagic/.github/workflows/GetContainerPlatforms.yml@v2
19+
with:
20+
image: ${{ inputs.rtpp-image }}:${{ inputs.rtpp-image-tag }}
21+
22+
run_voiptests:
23+
name: Run VoIPTests
24+
runs-on: ubuntu-latest
25+
needs: [set_env]
26+
env:
27+
BASE_IMAGE: ${{ inputs.rtpp-image }}:${{ inputs.rtpp-image-tag }}
28+
TARGETPLATFORM: ${{ matrix.platform }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
platform: ${{ fromJSON(needs.set_env.outputs.build-matrix) }}
33+
steps:
34+
- uses: actions/checkout@v5
35+
36+
- name: Checkout VoIPTests repo
37+
uses: actions/checkout@v5
38+
with:
39+
repository: 'sippy/voiptests'
40+
path: dist/voiptests
41+
42+
- name: Checkout RTPProxy repo
43+
uses: actions/checkout@v5
44+
with:
45+
repository: 'sippy/rtpproxy'
46+
path: dist/rtpproxy
47+
48+
- name: Set up QEMU
49+
if: matrix.platform != 'linux/386' && matrix.platform != 'linux/amd64'
50+
uses: docker/setup-qemu-action@v3
51+
with:
52+
platforms: ${{ env.TARGETPLATFORM }}
53+
54+
- name: Set up Docker Buildx
55+
uses: docker/setup-buildx-action@v3
56+
57+
- name: Cache wheels
58+
uses: actions/cache@v4
59+
with:
60+
path: dist_out/root/.cache
61+
key: voiptests-${{ env.BASE_IMAGE}}-${{ matrix.platform }}-pipcache-${{ github.run_id }}
62+
restore-keys: |
63+
voiptests-${{ env.BASE_IMAGE}}-${{ matrix.platform }}-pipcache-${{ github.run_id }}
64+
voiptests-${{ env.BASE_IMAGE}}-${{ matrix.platform }}-pipcache
65+
voiptests-${{ matrix.platform }}-pipcache
66+
67+
- name: Small things
68+
run: test -d dist_out || mkdir dist_out
69+
70+
- name: VoIP Tests
71+
uses: docker/build-push-action@v6
72+
env:
73+
DOCKER_BUILD_SUMMARY: false
74+
DOCKER_BUILD_RECORD_UPLOAD: false
75+
with:
76+
context: .
77+
file: ./docker/Dockerfile.voiptests
78+
build-args: |
79+
RTPPC_TYPE=unix
80+
BASE_IMAGE=${{ env.BASE_IMAGE }}
81+
platforms: ${{ env.TARGETPLATFORM }}
82+
outputs: type=local,dest=dist_out
83+
cache-from: type=gha
84+
cache-to: type=gha,mode=max

.github/workflows/python-wheels.yml

Lines changed: 5 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -54,74 +54,15 @@ jobs:
5454
pip install dist/sippy*.gz
5555
${PYTHON_CMD} -m unittest
5656
57-
set_env:
58-
name: List Supported Arches
59-
uses: sippy/cimagic/.github/workflows/GetContainerPlatforms.yml@v2
60-
with:
61-
image: sippylabs/rtpproxy:latest-debian_13-slim
62-
6357
voiptests:
64-
name: Run VoIPTests
65-
runs-on: ubuntu-latest
66-
needs: [set_env, build]
67-
env:
68-
BASE_IMAGE: sippylabs/rtpproxy:latest-debian_13-slim
69-
TARGETPLATFORM: ${{ matrix.platform }}
58+
name: VoIPTests
59+
uses: ./.github/workflows/.voiptests.yml
60+
with:
61+
rtpp-image-tag: latest-${{ matrix.rtpp-image-tag }}
7062
strategy:
7163
fail-fast: false
7264
matrix:
73-
platform: ${{ fromJSON(needs.set_env.outputs.build-matrix) }}
74-
steps:
75-
- uses: actions/checkout@v4
76-
77-
- name: Checkout VoIPTests repo
78-
uses: actions/checkout@v4
79-
with:
80-
repository: 'sippy/voiptests'
81-
path: dist/voiptests
82-
83-
- name: Checkout RTPProxy repo
84-
uses: actions/checkout@v4
85-
with:
86-
repository: 'sippy/rtpproxy'
87-
path: dist/rtpproxy
88-
89-
- name: Set up QEMU
90-
if: matrix.platform != 'linux/386' && matrix.platform != 'linux/amd64'
91-
uses: docker/setup-qemu-action@v3
92-
with:
93-
platforms: ${{ env.TARGETPLATFORM }}
94-
95-
- name: Set up Docker Buildx
96-
uses: docker/setup-buildx-action@v3
97-
98-
- name: Cache wheels
99-
uses: actions/cache@v4
100-
with:
101-
path: dist_out/root/.cache
102-
key: voiptests-${{ matrix.platform }}-pipcache-${{ github.run_id }}
103-
restore-keys: |
104-
voiptests-${{ matrix.platform }}-pipcache
105-
voiptests-${{ matrix.platform }}-pipcache-${{ github.run_id }}
106-
107-
- name: Small things
108-
run: test -d dist_out || mkdir dist_out
109-
110-
- name: VoIP Tests
111-
uses: docker/build-push-action@v6
112-
env:
113-
DOCKER_BUILD_SUMMARY: false
114-
DOCKER_BUILD_RECORD_UPLOAD: false
115-
with:
116-
context: .
117-
file: ./docker/Dockerfile.voiptests
118-
build-args: |
119-
RTPPC_TYPE=unix
120-
BASE_IMAGE=${{ env.BASE_IMAGE }}
121-
platforms: ${{ env.TARGETPLATFORM }}
122-
outputs: type=local,dest=dist_out
123-
cache-from: type=gha
124-
cache-to: type=gha,mode=max
65+
rtpp-image-tag: ['debian_13-slim', 'ubuntu_latest']
12566

12667
publish_wheels:
12768
name: Publish Puthon Wheels

0 commit comments

Comments
 (0)