-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 1.87 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: ci
on:
pull_request:
branches:
- dev
- master
push:
branches:
- master
workflow_dispatch:
permissions: write-all
jobs:
ci-test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: yanzhaowang/srs-env:fedora-41
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'
- name: install and env vars
run: |
dnf install -y conan nodejs
cd $GITHUB_WORKSPACE/..
echo "PARENT_DIR=$PWD" >> $GITHUB_ENV
echo "CONAN_HOME=$PWD/.conan2" >> $GITHUB_ENV
- name: restore cache
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
${{ env.PARENT_DIR }}/.conan2
key: srs-cache
- name: build
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
cmake --preset default
cmake --build ./build -- -j2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: test
run: |
cd build/bin
./srs_backend_test --gtest_output=xml
- name: publish test report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Google test
path: 'build/bin/test_detail.xml'
fail-on-error: true
reporter: java-junit
- name: cache-delete
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
gh cache delete ${{ steps.cache-restore.outputs.cache-primary-key }} || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: save cache
id: cache-save
uses: actions/cache/save@v4
with:
path: |
${{ env.PARENT_DIR }}/.conan2
key: ${{ steps.cache-restore.outputs.cache-primary-key }}