-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actions: Add CI for utest and coverage
- Loading branch information
Showing
7 changed files
with
87 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
|
||
jobs: | ||
k8s: | ||
name: release-k8s | ||
name: actions-release-k8s | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Test" | ||
|
||
on: [push pull_request] | ||
|
||
jobs: | ||
utest: | ||
name: actions-test-utest | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
################################################################ | ||
# Tests | ||
- name: Build test image | ||
run: docker build --tag srs:test -f trunk/Dockerfile.test trunk | ||
# For utest | ||
- name: Run SRS utest | ||
run: docker run --rm srs:test bash -c 'make && ./objs/srs_utest' | ||
coverage: | ||
name: actions-test-coverage | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
################################################################ | ||
# Tests | ||
- name: Build coverage image | ||
run: docker build --tag srs:cov -f trunk/Dockerfile.cov trunk | ||
# For coverage | ||
- name: Run SRS covergae | ||
if: ${{ startsWith(github.ref, 'refs/heads/') }} | ||
run: | | ||
SRS_BRANCH=$(echo ${{ github.ref }}| awk -F '/' '{print $3}') && SRS_SHA=${{ github.sha }} && SRS_PROJECT=/srs | ||
echo "For ref=${{ github.ref }}, sha=${{ github.sha }}, SRS_BRANCH=$SRS_BRANCH, SRS_SHA=$SRS_SHA, SRS_PROJECT=$SRS_PROJECT" | ||
docker run --rm --env SRS_BRANCH=$SRS_BRANCH --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \ | ||
srs:cov bash -c 'make && ./objs/srs_utest && bash auto/coverage.sh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ossrs/srs:dev | ||
|
||
# Install depends tools. | ||
RUN yum install -y gcc make gcc-c++ patch unzip perl git | ||
|
||
# Build and install SRS. | ||
COPY . /srs/trunk | ||
WORKDIR /srs/trunk | ||
RUN ./configure --with-utest --gcov --jobs=2 && make -j2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ossrs/srs:dev | ||
|
||
# Install depends tools. | ||
RUN yum install -y gcc make gcc-c++ patch unzip perl git | ||
|
||
# Build and install SRS. | ||
COPY . /srs/trunk | ||
WORKDIR /srs/trunk | ||
RUN ./configure --with-utest --jobs=2 && make -j2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters