Skip to content

Upgrade trivy scans (#997) #1656

Upgrade trivy scans (#997)

Upgrade trivy scans (#997) #1656

name: win_gtest
on:
# allow manually trigger
workflow_dispatch:
push:
branches:
- main
- 'maint-**'
pull_request:
branches:
- main
- 'maint-**'
concurrency:
group: win-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# Customize the env if
BUILD_TYPE: Release
DPDK_VERSION: 23.11
TEST_PORT_P: 0000:af:00.0
TEST_PORT_R: 0000:af:00.1
MSYSTEM: UCRT64
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changed: ${{ steps.filter.outputs.windows_gtest == 'true' }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v2
id: filter
with:
filters: .github/path_filters.yml
Build_and_Test:
needs: changes
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
runs-on: [Windows, self-hosted]
timeout-minutes: 60
defaults:
run:
shell: C:\msys64\msys2.cmd {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Update dependencies
run: |
pacman --noconfirm -Syuu
pacman --noconfirm -S --needed --overwrite git base-devel unzip pactoys
pacboy --noconfirm -S --needed pkgconf:p openssl:p gcc:p meson:p json-c:p libpcap:p gtest:p SDL2:p SDL2_ttf:p dlfcn:p
- name: Checkout IMTL code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Convert patches for DPDK
run: |
cd patches/dpdk/${{ env.DPDK_VERSION }}
ls *.patch | xargs -I{} bash -c 'if [[ $(sed -n '1p' "{}") =~ ^../.*\.patch$ ]]; then cp "$(cat "{}")" "{}"; fi'
cd windows
ls *.patch | xargs -I{} bash -c 'if [[ $(sed -n '1p' "{}") =~ ^../.*\.patch$ ]]; then cp "$(cat "{}")" "{}"; fi'
- name: Checkout DPDK code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
repository: 'DPDK/dpdk'
ref: v${{ env.DPDK_VERSION }}
path: dpdk
clean: true
- name: Apply patches for DPDK
run: |
cd dpdk
git config user.name github-actions
git config user.email [email protected]
for f in ../patches/dpdk/${{ env.DPDK_VERSION }}/*.patch; do patch -p1 < "$f"; done
for f in ../patches/dpdk/${{ env.DPDK_VERSION }}/windows/*.patch; do patch -p1 < "$f"; done
- name: Build and install DPDK
run: |
cd dpdk
meson setup build --wipe
meson install -C build
- name: Build IMTL lib
run: |
meson setup build --wipe
meson install -C build
- name: Build gtest
run: |
cd tests
meson setup build --wipe
meson compile -C build
- name: Kill previous gtest routine
shell: cmd
run: |
taskkill /f /im KahawaiTest.exe || VER>NUL
- name: Run st2110 test cases except st22
run: |
./tests/build/KahawaiTest --auto_start_stop --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --gtest_filter=-St22*