Skip to content

Commit aac0bc8

Browse files
committed
ci: add automated tests
1 parent 6b30538 commit aac0bc8

File tree

3 files changed

+81
-14
lines changed

3 files changed

+81
-14
lines changed

.github/workflows/codeql.yml

+15-12
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ jobs:
3737
languages: ${{ matrix.language }}
3838
build-mode: ${{ matrix.build-mode }}
3939

40-
# These steps install the dependencies needed for the build
41-
- if: matrix.build-mode == 'manual'
42-
name: Install GStreamer
43-
shell: bash
44-
run: sudo apt-get install -y libgstreamer1.0-dev
45-
- if: matrix.build-mode == 'manual'
46-
name: Install GPAC
40+
# These steps install the dependencies needed for the build
41+
- name: Install GPAC
42+
if: matrix.language == 'c-cpp'
4743
shell: bash
4844
working-directory: ${{ runner.temp }}
4945
run: |
@@ -52,15 +48,22 @@ jobs:
5248
./configure && make -j
5349
sudo make install
5450
55-
# This step builds the project.
56-
- if: matrix.build-mode == 'manual'
57-
name: Build
51+
- name: Install GStreamer
52+
if: matrix.language == 'c-cpp'
53+
shell: bash
54+
run: |
55+
sudo apt-get update
56+
sudo apt-get install -y libgstreamer1.0-dev
57+
58+
# This step builds the project.
59+
- name: Build
60+
if: matrix.language == 'c-cpp'
5861
shell: bash
5962
run: |
60-
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build
63+
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -B build
6164
cmake --build build -j
6265
63-
# This step performs the CodeQL analysis.
66+
# This step performs the CodeQL analysis.
6467
- name: Perform CodeQL Analysis
6568
uses: github/codeql-action/analyze@v3
6669
with:

.github/workflows/test.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
# These steps install the dependencies needed for the build
19+
- name: Install GPAC
20+
shell: bash
21+
working-directory: ${{ runner.temp }}
22+
run: |
23+
git clone --depth 1 https://github.com/gpac/gpac.git
24+
cd gpac
25+
./configure && make -j
26+
sudo make install
27+
28+
- name: Install GStreamer
29+
shell: bash
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
33+
34+
# This step installs the Rust toolchain
35+
- name: Install Rust
36+
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8
37+
38+
# This step installs the dependencies needed for the tests
39+
- name: Install cmafmux element
40+
shell: bash
41+
working-directory: ${{ runner.temp }}
42+
run: |
43+
git clone --depth 1 https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
44+
cd gst-plugins-rs
45+
cargo install cargo-c
46+
cargo cbuild -p gst-plugin-fmp4
47+
cargo cinstall -p gst-plugin-fmp4 --destdir bin
48+
mkdir -p $HOME/.local/share/gstreamer-1.0/plugins
49+
cp bin/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/libgstfmp4.so $HOME/.local/share/gstreamer-1.0/plugins/
50+
51+
# This step builds the project.
52+
- name: Build
53+
shell: bash
54+
run: |
55+
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -B build
56+
cmake --build build -j
57+
58+
# Run the tests
59+
- name: Test
60+
shell: bash
61+
env:
62+
GST_PLUGIN_PATH: ${{ github.workspace}}/build:$HOME/.local/share/gstreamer-1.0/plugins
63+
GST_DEBUG: 3
64+
run: ./build/tests/gstgpacplugin_test

tests/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ endif()
1515
include(FetchContent)
1616
FetchContent_Declare(
1717
googletest
18-
URL https://github.com/google/googletest/archive/2b6b042a77446ff322cd7522ca068d9f2a21c1d1.zip
19-
DOWNLOAD_EXTRACT_TIMESTAMP
18+
GIT_REPOSITORY https://github.com/google/googletest.git
19+
GIT_TAG 2b6b042a77446ff322cd7522ca068d9f2a21c1d1
2020
)
2121

2222
# For Windows: Prevent overriding the parent project's compiler/linker settings

0 commit comments

Comments
 (0)