Actions: Fix GitHub actions warnings.

pull/3341/head
winlin 2 years ago
parent f6e0b1c894
commit 23b7939574

@ -15,7 +15,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

@ -9,12 +9,11 @@ on:
jobs:
envs:
name: envs
runs-on: ubuntu-20.04
steps:
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# The github.ref is, for example, refs/tags/v5.0.145 or refs/tags/v5.0-r8
# Generate variables like:
# SRS_TAG=v5.0-r8
@ -31,14 +30,16 @@ jobs:
echo "SRS_VERSION=$SRS_VERSION" >> $GITHUB_ENV
SRS_MAJOR=$(echo $SRS_TAG| cut -c 2)
echo "SRS_MAJOR=$SRS_MAJOR" >> $GITHUB_ENV
outputs:
SRS_TAG: ${{ env.SRS_TAG }}
SRS_VERSION: ${{ env.SRS_VERSION }}
SRS_MAJOR: ${{ env.SRS_MAJOR }}
# See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
- name: Set output
run: |
echo "SRS_TAG=${{ env.SRS_TAG }}" >> $GITHUB_OUTPUT
echo "SRS_VERSION=${{ env.SRS_VERSION }}" >> $GITHUB_OUTPUT
echo "SRS_MAJOR=${{ env.SRS_MAJOR }}" >> $GITHUB_OUTPUT
runs-on: ubuntu-20.04
test:
name: test
runs-on: ubuntu-20.04
needs:
- envs
steps:
@ -51,7 +52,7 @@ jobs:
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
##################################################################################################################
# Tests
- name: Build test image
@ -65,12 +66,10 @@ jobs:
docker run --rm srs:test bash -c 'make && \
./objs/srs -c conf/regression-test.conf && \
cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
outputs:
SRS_TEST_DONE: ok
runs-on: ubuntu-20.04
draft:
name: draft
runs-on: ubuntu-20.04
needs:
- envs
steps:
@ -84,12 +83,14 @@ jobs:
tag: ${{ github.ref }}
draft: true
prerelease: true
outputs:
SRS_RELEASE_ID: ${{ steps.create_draft.outputs.id }}
# See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
- name: Set output
run: |
echo "SRS_RELEASE_ID=${{ steps.create_draft.outputs.id }}" >> $GITHUB_OUTPUT
runs-on: ubuntu-20.04
cygwin64:
name: cygwin64
runs-on: windows-latest
needs:
- envs
- draft
@ -104,7 +105,7 @@ jobs:
install-dir: C:\cygwin64
##################################################################################################################
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
##################################################################################################################
- name: Covert output to env
env:
@ -152,13 +153,15 @@ jobs:
with:
release_id: ${{ env.SRS_RELEASE_ID }}
assets_path: ${{ env.SRS_CYGWIN_TAR }}
outputs:
SRS_CYGWIN_TAR: ${{ env.SRS_CYGWIN_TAR }}
SRS_CYGWIN_MD5: ${{ env.SRS_CYGWIN_MD5 }}
# See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
- name: Set output
run: |
echo "SRS_CYGWIN_TAR=${{ env.SRS_CYGWIN_TAR }}" >> $GITHUB_OUTPUT
echo "SRS_CYGWIN_MD5=${{ env.SRS_CYGWIN_MD5 }}" >> $GITHUB_OUTPUT
runs-on: windows-latest
linux:
name: linux
runs-on: ubuntu-20.04
needs:
- envs
- draft
@ -173,7 +176,7 @@ jobs:
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
##################################################################################################################
# Create source tar for release. Note that it's for OpenWRT package srs-server, so the filename MUST be
# srs-server-xxx.tar.gz, because the package is named srs-server.
@ -219,15 +222,17 @@ jobs:
with:
release_id: ${{ env.SRS_RELEASE_ID }}
assets_path: ${{ env.SRS_SOURCE_TAR }}
outputs:
SRS_PACKAGE_ZIP: ${{ env.SRS_PACKAGE_ZIP }}
SRS_PACKAGE_MD5: ${{ env.SRS_PACKAGE_MD5 }}
SRS_SOURCE_TAR: ${{ env.SRS_SOURCE_TAR }}
SRS_SOURCE_MD5: ${{ env.SRS_SOURCE_MD5 }}
# See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
- name: Set output
run: |
echo "SRS_PACKAGE_ZIP=${{ env.SRS_PACKAGE_ZIP }}" >> $GITHUB_OUTPUT
echo "SRS_PACKAGE_MD5=${{ env.SRS_PACKAGE_MD5 }}" >> $GITHUB_OUTPUT
echo "SRS_SOURCE_TAR=${{ env.SRS_SOURCE_TAR }}" >> $GITHUB_OUTPUT
echo "SRS_SOURCE_MD5=${{ env.SRS_SOURCE_MD5 }}" >> $GITHUB_OUTPUT
runs-on: ubuntu-20.04
docker-srs:
name: docker-srs
runs-on: ubuntu-20.04
needs:
- envs
steps:
@ -240,14 +245,14 @@ jobs:
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
##################################################################################################################
# Create main images for Docker
- name: Login to docker hub
@ -273,12 +278,10 @@ jobs:
ossrs/srs:${{ env.SRS_VERSION }}
ossrs/srs:${{ env.SRS_MAJOR }}
ossrs/srs:v${{ env.SRS_MAJOR }}
outputs:
SRS_DOCKER_DONE: ok
runs-on: ubuntu-20.04
aliyun-srs:
name: aliyun-srs
runs-on: ubuntu-20.04
needs:
- envs
- docker-srs
@ -306,12 +309,10 @@ jobs:
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_VERSION }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_MAJOR }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v${{ env.SRS_MAJOR }}
outputs:
SRS_ALIYUN_DONE: ok
runs-on: ubuntu-20.04
update:
name: update
runs-on: ubuntu-20.04
needs:
- aliyun-srs
- envs
@ -325,7 +326,7 @@ jobs:
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
##################################################################################################################
# Generate variables like:
# SRS_LH_OSSRS_NET=1.2.3.4
@ -373,12 +374,10 @@ jobs:
docker rmi -f $image
echo "Remove image $image, r0=$?"
done
outputs:
SRS_UPDATE_DONE: ok
runs-on: ubuntu-20.04
release:
name: release
runs-on: ubuntu-20.04
needs:
- update
- envs
@ -402,7 +401,7 @@ jobs:
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Create release.
# TODO: FIXME: Refine the release when 5.0 released
# TODO: FIXME: Change prerelease to false when 5.0 released
@ -448,6 +447,7 @@ jobs:
* [中文FAQ](https://ossrs.net/lts/zh-cn/faq), [功能列表](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/Features.md#features) 或 [修订历史](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/CHANGELOG.md#changelog)
draft: false
prerelease: true
runs-on: ubuntu-20.04
done:
name: done

@ -16,13 +16,12 @@ on: [push, pull_request]
# build-cross-arm(3m)
# build-cross-aarch64(3m)
# multiple-arch-amd64(2m)
# utest(3m)
# coverage(3m) - Must depends on utest.
# utest(3m)
# coverage(3m)
jobs:
cygwin64-cache:
name: cygwin64-cache
runs-on: ubuntu-20.04
steps:
- name: Download Cache for Cygwin
run: |
@ -30,17 +29,15 @@ jobs:
tar jcf /srs/objs.tar.bz2 objs &&
pwd && du -sh *
##################################################################################################################
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: srs-cache
path: objs.tar.bz2
retention-days: 1
outputs:
SRS_CYGWIN_CACHE_DONE: ok
runs-on: ubuntu-20.04
cygwin64:
name: cygwin64
runs-on: windows-latest
needs:
- cygwin64-cache
steps:
@ -54,10 +51,10 @@ jobs:
install-dir: C:\cygwin64
##################################################################################################################
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
##################################################################################################################
# Note that we must download artifact after checkout code, because it will change the files in workspace.
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: srs-cache
- uses: geekyeggo/delete-artifact@v2
@ -75,17 +72,15 @@ jobs:
tar xf objs.tar.bz2 -C /usr/local/srs-cache/srs/trunk/ && du -sh /usr/local/srs-cache/srs/trunk/* &&
cd ${WORKDIR}/trunk && ./configure --gb28181=on --utest=on && ls -lh && du -sh * && du -sh objs/* &&
cd ${WORKDIR}/trunk && make utest && ./objs/srs_utest
outputs:
SRS_CYGWIN_DONE: ok
runs-on: windows-latest
build-centos7:
name: build-centos7
runs-on: ubuntu-20.04
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Build for CentOS 7
- name: Build on CentOS7, baseline
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-baseline .
@ -97,93 +92,83 @@ jobs:
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-no-asm .
- name: Build on CentOS7, C++98, no FFmpeg
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-ansi-no-ffmpeg .
outputs:
SRS_BUILD_CENTOS7_DONE: ok
runs-on: ubuntu-20.04
build-ubuntu16:
name: build-ubuntu16
runs-on: ubuntu-20.04
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Build for Ubuntu16
- name: Build on Ubuntu16, baseline
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-baseline .
- name: Build on Ubuntu16, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-all .
outputs:
SRS_BUILD_UBUNTU16_DONE: ok
runs-on: ubuntu-20.04
build-ubuntu18:
name: build-ubuntu18
runs-on: ubuntu-20.04
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Build for Ubuntu18
- name: Build on Ubuntu18, baseline
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-baseline .
- name: Build on Ubuntu18, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-all .
outputs:
SRS_BUILD_UBUNTU18_DONE: ok
runs-on: ubuntu-20.04
build-ubuntu20:
name: build-ubuntu20
runs-on: ubuntu-20.04
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Build for Ubuntu20
- name: Build on Ubuntu20, baseline
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-baseline .
- name: Build on Ubuntu20, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-all .
outputs:
SRS_BUILD_UBUNTU20_DONE: ok
runs-on: ubuntu-20.04
build-cross-arm:
name: build-cross-arm
runs-on: ubuntu-20.04
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Cross Build for ARMv7 on Ubuntu16
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cross-armv7 .
- name: Cross Build for ARMv7 on Ubuntu20
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cross-armv7 .
outputs:
SRS_BUILD_CROSS_ARM_DONE: ok
runs-on: ubuntu-20.04
build-cross-aarch64:
name: build-cross-aarch64
runs-on: ubuntu-20.04
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Cross Build for AARCH64 on Ubuntu16
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cross-aarch64 .
- name: Cross Build for AARCH64 on Ubuntu20
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cross-aarch64 .
outputs:
SRS_BUILD_CROSS_AARCH64_DONE: ok
runs-on: ubuntu-20.04
utest:
name: utest
runs-on: ubuntu-20.04
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Tests
- name: Build test image
run: docker build --tag srs:test -f trunk/Dockerfile.test .
@ -196,17 +181,15 @@ jobs:
docker run --rm srs:test bash -c 'make && \
./objs/srs -c conf/regression-test.conf && \
cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
outputs:
SRS_UTEST_DONE: ok
runs-on: ubuntu-20.04
coverage:
name: coverage
runs-on: ubuntu-20.04
needs:
- utest
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Tests
- name: Build coverage image
run: docker build --tag srs:cov -f trunk/Dockerfile.cov .
@ -231,92 +214,86 @@ jobs:
--env SRS_BRANCH=$SRS_BRANCH --env SRS_PR=$SRS_PR --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \
srs:cov bash -c 'make utest && ./objs/srs_utest && bash auto/codecov.sh'
#
outputs:
SRS_COVERAGE_DONE: ok
runs-on: ubuntu-20.04
multiple-arch-armv7:
name: multiple-arch-armv7
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Build multiple archs image
run: |
docker buildx build --platform linux/arm/v7 \
--output "type=image,push=false" \
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \
--build-arg INSTALLDEPENDS="NO" \
-f trunk/Dockerfile .
outputs:
SRS_MULTIPLE_ARCH_ARMV7_DONE: ok
runs-on: ubuntu-20.04
multiple-arch-aarch64:
name: multiple-arch-aarch64
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Build multiple archs image
run: |
docker buildx build --platform linux/arm64/v8 \
--output "type=image,push=false" \
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \
--build-arg INSTALLDEPENDS="NO" \
-f trunk/Dockerfile .
outputs:
SRS_MULTIPLE_ARCH_AARCH64_DONE: ok
runs-on: ubuntu-20.04
multiple-arch-amd64:
name: multiple-arch-amd64
runs-on: ubuntu-20.04
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Build multiple archs image
run: |
docker buildx build --platform linux/amd64 \
--output "type=image,push=false" \
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \
-f trunk/Dockerfile .
outputs:
SRS_MULTIPLE_ARCH_AMD64_DONE: ok
runs-on: ubuntu-20.04
fast:
name: fast
needs:
- cygwin64-cache
runs-on: ubuntu-20.04
steps:
- run: echo 'Start fast jobs'
outputs:
SRS_FAST_DONE: ok
runs-on: ubuntu-20.04
done:
name: done
needs:
- cygwin64
- coverage
- utest
- build-centos7
- build-ubuntu16
- build-ubuntu18

@ -2,10 +2,13 @@ ARG ARCH
ARG IMAGE=ossrs/srs:ubuntu20
FROM ${ARCH}${IMAGE} AS build
ARG CONFARGS
ARG MAKEARGS
ARG INSTALLDEPENDS
ARG BUILDPLATFORM
ARG TARGETPLATFORM
ARG SRS_AUTO_PACKAGER
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, PACKAGER: ${#SRS_AUTO_PACKAGER}"
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, PACKAGER: ${#SRS_AUTO_PACKAGER}, CONFARGS: ${CONFARGS}, MAKEARGS: ${MAKEARGS}, INSTALLDEPENDS: ${INSTALLDEPENDS}"
# https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
ENV DEBIAN_FRONTEND noninteractive
@ -15,7 +18,9 @@ ENV DEBIAN_FRONTEND noninteractive
SHELL ["/bin/bash", "-c"]
# Install depends tools.
RUN apt-get update && apt-get install -y gcc make g++ patch unzip perl git libasan5
RUN if [[ $INSTALLDEPENDS != 'NO' ]]; then \
apt-get update && apt-get install -y gcc make g++ patch unzip perl git libasan5; \
fi
# Copy source code to docker.
COPY . /srs
@ -24,7 +29,7 @@ WORKDIR /srs/trunk
# Build and install SRS.
# Note that SRT is enabled by default, so we configure without --srt=on.
# Note that we have copied all files by make install.
RUN ./configure --gb28181=on --sanitizer-static=on && make && make install
RUN ./configure --gb28181=on --sanitizer-static=on ${CONFARGS} && make ${MAKEARGS} && make install
############################################################
# dist

@ -40,6 +40,8 @@ SRS_FFMPEG_FIT=RESERVED
SRS_PREFIX=/usr/local/srs
SRS_DEFAULT_CONFIG=conf/srs.conf
SRS_JOBS=1
# If enabled, force to use SRS_JOBS for make on linux, however you're able to overwrite by -jN on macOS.
SRS_FORCE_MAKE_JOBS=YES
SRS_STATIC=NO
# If enabled, link shared libraries for libst.so which uses MPL license.
# See https://ossrs.net/lts/zh-cn/license#state-threads
@ -243,6 +245,7 @@ function parse_user_option() {
--help) help=yes ;;
--jobs) SRS_JOBS=${value} ;;
--force-make-jobs) SRS_FORCE_MAKE_JOBS=${value} ;;
--prefix) SRS_PREFIX=${value} ;;
--config) SRS_DEFAULT_CONFIG=${value} ;;

17
trunk/configure vendored

@ -494,15 +494,22 @@ SRS_PREFIX=${SRS_PREFIX}
SRS_DEFAULT_CONFIG=${SRS_DEFAULT_CONFIG}
__REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX)
JOBS=\$(shell echo \$(MAKEFLAGS)| grep -qE '\-j[0-9]+' || echo " ${SRS_JOBS}")
default: server
all: _default
SRS_FORCE_MAKE_JOBS=${SRS_FORCE_MAKE_JOBS}
END
if [[ $SRS_FORCE_MAKE_JOBS == YES ]]; then
cat << END >> ${SRS_MAKEFILE}
JOBS=\$(shell echo \$(MAKEFLAGS)| grep -qE '\-j[0-9]+' || echo " ${SRS_JOBS}")
END
fi
# the real entry for all platform:
cat << END >> ${SRS_MAKEFILE}
default: server
all: _default
_default: server srs_ingest_hls utest $__mdefaults
help:
@ -579,7 +586,7 @@ END
cat << END >> ${SRS_MAKEFILE}
server: _prepare_dir
@echo "Build the SRS server"
@echo "Build the SRS server, JOBS=\${JOBS}, FORCE_MAKE_JOBS=${SRS_FORCE_MAKE_JOBS}"
\$(MAKE)\$(JOBS) -f ${SRS_OBJS}/Makefile srs
@bash objs/_srs_build_summary.sh

Loading…
Cancel
Save