Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

WIP: ci: switch to reusable templates #2879

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/clang-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: clang-ubuntu

on:
workflow_call:
inputs:
on:
description: 'Which runner to use?'
type: string
required: true
clang:
description: 'Which clang compiler to use?'
type: string
required: true
cmake-flags:
description: 'And additional cmake flags?'
type: string
required: true

env:
CFLAGS: -O2 -Wformat -Wformat-security -Wall -Werror -D_FORTIFY_SOURCE=2 -fstack-protector-strong

jobs:
build:
runs-on: ${{inputs.on}}
env:
CC: /usr/bin/clang-${{inputs.clang}}
CXX: /usr/bin/clang++-${{inputs.clang}}
ASM: /usr/bin/clang-${{inputs.clang}}
steps:
- name: checkout libmfx
uses: actions/checkout@v2
with:
path: libmfx
- name: checkout libva
uses: actions/checkout@v2
with:
repository: intel/libva
path: libva
- name: install toolchain
run: |
if [[ -e $CC && -e $CXX ]]; then \
echo "clang-${{inputs.clang}} already presents in the image"; \
else \
echo "clang-${{inputs.clang}} missed in the image, installing from llvm"; \
echo "deb [trusted=yes] http://apt.llvm.org/focal/ llvm-toolchain-focal-${{inputs.clang}} main" | sudo tee -a /etc/apt/sources.list; \
sudo apt-get update; \
sudo apt-get install -y --no-install-recommends clang-${{inputs.clang}}; \
fi
- name: install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake \
libdrm-dev \
libegl1-mesa-dev \
libgl1-mesa-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-dri3-dev \
libxcb-present-dev \
libxext-dev \
libxfixes-dev \
libwayland-dev \
ocl-icd-opencl-dev \
opencl-clhpp-headers \
make
- name: print tools versions
run: |
cmake --version
$CC --version
$CXX --version
- name: build libva
run: |
cd libva
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
make -j$(nproc)
sudo make install
- name: build libmfx
run: |
cd libmfx
mkdir build && cd build
echo "inputs.cmake-flags: ${{inputs.cmake-flags}}"
cmake ${{inputs.cmake-flags}} -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" -DCMAKE_CXX_FLAGS_RELEASE="$CFLAGS" ..
make -j$(nproc)
make test
sudo make install

76 changes: 76 additions & 0 deletions .github/workflows/gcc-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: gcc-ubuntu

on:
workflow_call:
inputs:
on:
description: 'Which runner to use?'
type: string
required: true
gcc:
description: 'Which gcc compiler to use?'
type: string
required: true
cmake-flags:
description: 'And additional cmake flags?'
type: string
required: true

env:
CFLAGS: -O2 -Wformat -Wformat-security -Wall -Werror -D_FORTIFY_SOURCE=2 -fstack-protector-strong

jobs:
build:
runs-on: ${{inputs.on}}
env:
CC: /usr/bin/gcc-${{inputs.gcc}}
CXX: /usr/bin/g++-${{inputs.gcc}}
ASM: /usr/bin/gcc-${{inputs.gcc}}
steps:
- name: checkout libmfx
uses: actions/checkout@v2
with:
path: libmfx
- name: checkout libva
uses: actions/checkout@v2
with:
repository: intel/libva
path: libva
- name: install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake \
libdrm-dev \
libegl1-mesa-dev \
libgl1-mesa-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-dri3-dev \
libxcb-present-dev \
libxext-dev \
libxfixes-dev \
libwayland-dev \
ocl-icd-opencl-dev \
opencl-clhpp-headers \
make
- name: print tools versions
run: |
cmake --version
$CC --version
$CXX --version
- name: build libva
run: |
cd libva
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
make -j$(nproc)
sudo make install
- name: build libmfx
run: |
cd libmfx
mkdir build && cd build
echo "inputs.cmake-flags: ${{inputs.cmake-flags}}"
cmake ${{inputs.cmake-flags}} -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" -DCMAKE_CXX_FLAGS_RELEASE="$CFLAGS" ..
make -j$(nproc)
sudo make install

Loading