1
0
mirror of https://github.com/coturn/coturn.git synced 2025-10-25 13:00:59 +02:00
This commit is contained in:
tyranron 2021-04-07 18:04:20 +03:00
parent 0aa5c806c7
commit 3bad03d825
No known key found for this signature in database
GPG Key ID: 762E144FB230A4F0
2 changed files with 10 additions and 8 deletions

View File

@ -34,21 +34,21 @@ jobs:
- uses: docker/setup-buildx-action@v1 - uses: docker/setup-buildx-action@v1
- name: Detect correct Git ref for image build - name: Detect correct Git ref for image build
id: gitref id: git
uses: actions/github-script@v3 uses: actions/github-script@v3
with: with:
result-encoding: string
script: | script: |
let ref = 'HEAD'; let out = {ref: 'HEAD', ver: ''};
if ('${{ github.ref }}'.startsWith('refs/tags/docker/')) { if ('${{ github.ref }}'.startsWith('refs/tags/docker/')) {
ref = '${{ github.ref }}'.substring(17).split('-')[0]; out.ref = '${{ github.ref }}'.substring(17).split('-')[0];
out.ver = out.ref;
} }
return ref; return out;
- name: Pre-build fresh Docker images cache - name: Pre-build fresh Docker images cache
run: make docker.build.cache no-cache=yes run: make docker.build.cache no-cache=yes
DOCKERFILE=${{ matrix.dockerfile }} DOCKERFILE=${{ matrix.dockerfile }}
ref=${{ steps.gitref.outputs.result }} ref=${{ fromJSON(steps.git.outputs.result).ref }}
working-directory: ./docker/coturn working-directory: ./docker/coturn
if: ${{ !matrix.cache }} if: ${{ !matrix.cache }}
@ -62,7 +62,7 @@ jobs:
- name: Pre-build Docker images cache - name: Pre-build Docker images cache
run: make docker.build.cache no-cache=no run: make docker.build.cache no-cache=no
DOCKERFILE=${{ matrix.dockerfile }} DOCKERFILE=${{ matrix.dockerfile }}
ref=${{ steps.gitref.outputs.result }} ref=${{ fromJSON(steps.git.outputs.result).ref }}
working-directory: ./docker/coturn working-directory: ./docker/coturn
if: ${{ matrix.cache }} if: ${{ matrix.cache }}
@ -76,6 +76,8 @@ jobs:
make npm.install make npm.install
make test.docker platforms=@all build=yes DOCKERFILE=${{ matrix.dockerfile }} make test.docker platforms=@all build=yes DOCKERFILE=${{ matrix.dockerfile }}
env:
COTURN_VERSION: ${{ fromJSON(steps.git.outputs.result).ver }}
working-directory: ./docker/coturn working-directory: ./docker/coturn
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry

View File

@ -30,7 +30,7 @@
} }
@test "Coturn has correct version" { @test "Coturn has correct version" {
[ -z "$COTURN_VER" ] && skip [ -z "$COTURN_VERSION" ] && skip
run docker run --rm --entrypoint sh $IMAGE -c \ run docker run --rm --entrypoint sh $IMAGE -c \
"turnserver -o --log-file=stdout | grep 'Version Coturn' \ "turnserver -o --log-file=stdout | grep 'Version Coturn' \