mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Windows: Support cygwin cache for test. (#3259)
This commit is contained in:
parent
b18ee398ed
commit
b9284b6cc6
2 changed files with 33 additions and 9 deletions
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
|
@ -4,9 +4,29 @@ name: "Test"
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
cygwin64-cache:
|
||||||
|
name: cygwin64-cache
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Download Cache for Cygwin
|
||||||
|
run: |
|
||||||
|
docker run --rm -v $(pwd):/srs -w /usr/local/srs-cache/srs/trunk ossrs/srs:cygwin64-cache \
|
||||||
|
tar jcf /srs/objs.tar.bz2 objs &&
|
||||||
|
pwd && du -sh *
|
||||||
|
##################################################################################################################
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: srs-cache
|
||||||
|
path: objs.tar.bz2
|
||||||
|
retention-days: 1
|
||||||
|
outputs:
|
||||||
|
SRS_CYGWIN_CACHE_DONE: ok
|
||||||
|
|
||||||
cygwin64:
|
cygwin64:
|
||||||
name: cygwin64
|
name: cygwin64
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
needs:
|
||||||
|
- cygwin64-cache
|
||||||
steps:
|
steps:
|
||||||
# See https://github.com/cygwin/cygwin-install-action#parameters
|
# See https://github.com/cygwin/cygwin-install-action#parameters
|
||||||
# Note that https://github.com/egor-tensin/setup-cygwin fails to install packages.
|
# Note that https://github.com/egor-tensin/setup-cygwin fails to install packages.
|
||||||
|
@ -20,15 +40,23 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
##################################################################################################################
|
##################################################################################################################
|
||||||
|
# Note that we must download artifact after checkout code, because it will change the files in workspace.
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: srs-cache
|
||||||
|
- uses: geekyeggo/delete-artifact@v2
|
||||||
|
with:
|
||||||
|
name: srs-cache
|
||||||
|
##################################################################################################################
|
||||||
- name: Build and test SRS
|
- name: Build and test SRS
|
||||||
env:
|
env:
|
||||||
SHELLOPTS: igncr
|
SHELLOPTS: igncr
|
||||||
SRS_WORKSPACE: ${{ github.workspace }}
|
SRS_WORKSPACE: ${{ github.workspace }}
|
||||||
shell: C:\cygwin64\bin\bash.exe --login '{0}'
|
shell: C:\cygwin64\bin\bash.exe --login '{0}'
|
||||||
run: |
|
run: |
|
||||||
export PATH=/usr/bin:/usr/local/bin &&
|
WORKDIR=$(cygpath -u $SRS_WORKSPACE) && export PATH=/usr/bin:/usr/local/bin && cd ${WORKDIR} &&
|
||||||
cd $(cygpath -u $SRS_WORKSPACE)/trunk && ./configure --utest=on && make utest &&
|
pwd && ls -lh && rm -rf trunk/objs && tar xf objs.tar.bz2 -C trunk/ && du -sh trunk/* &&
|
||||||
./objs/srs_utest
|
cd ${WORKDIR}/trunk && ./configure --utest=on && make utest && ./objs/srs_utest
|
||||||
outputs:
|
outputs:
|
||||||
SRS_CYGWIN_DONE: ok
|
SRS_CYGWIN_DONE: ok
|
||||||
|
|
||||||
|
@ -121,8 +149,6 @@ jobs:
|
||||||
build-cross-arm:
|
build-cross-arm:
|
||||||
name: build-cross-arm
|
name: build-cross-arm
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs:
|
|
||||||
- utest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -136,8 +162,6 @@ jobs:
|
||||||
build-cross-aarch64:
|
build-cross-aarch64:
|
||||||
name: build-cross-aarch64
|
name: build-cross-aarch64
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs:
|
|
||||||
- utest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
|
@ -317,8 +317,8 @@ echo ""
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
# Try to load cache if exists /usr/local/srs-cache
|
# Try to load cache if exists /usr/local/srs-cache
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
# Use srs-cache from base image.
|
# Use srs-cache from base image. See https://github.com/ossrs/dev-docker/blob/ubuntu20-cache/Dockerfile
|
||||||
# See https://github.com/ossrs/dev-docker/blob/ubuntu20-cache/Dockerfile
|
# Note that the cache for cygwin is not under /usr/local, but copy to objs instead.
|
||||||
if [[ -d /usr/local/srs-cache/srs/trunk/objs && $(pwd) != "/usr/local/srs-cache/srs/trunk" ]]; then
|
if [[ -d /usr/local/srs-cache/srs/trunk/objs && $(pwd) != "/usr/local/srs-cache/srs/trunk" ]]; then
|
||||||
SOURCE_DIR=$(ls -d /usr/local/srs-cache/srs/trunk/objs/Platform-* 2>/dev/null|head -n 1)
|
SOURCE_DIR=$(ls -d /usr/local/srs-cache/srs/trunk/objs/Platform-* 2>/dev/null|head -n 1)
|
||||||
if [[ -d $SOURCE_DIR ]]; then
|
if [[ -d $SOURCE_DIR ]]; then
|
||||||
|
|
Loading…
Reference in a new issue