Skip to content

Update

Update #64

Workflow file for this run

name: CI/CD
on:
push:
pull_request:
workflow_dispatch:
jobs:
linux:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler:
- {
id: gcc,
c: gcc-13,
cxx: g++-13,
}
- {
id: clang,
c: clang-16,
cxx: clang++-16,
}
build_type: [debug, release]
name: 🐧-${{ matrix.compiler.id }}-${{ matrix.build_type }}
steps:
- name: Устанавливаем зависимости
run: |
sudo apt update
sudo apt install libgl1-mesa-dev libxrandr-dev
- name: Скачиваем репозиторий
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
path: repo
- name: Генерируем проекты
run: |
cmake repo -B build -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=${{ matrix.compiler.c }} -D CMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D DV_ALL_WARNINGS=1 -D DV_CTEST=1
- name: Компилируем
run: |
cmake --build build
- name: CTest
run: |
xvfb-run ctest --verbose --test-dir build --timeout 60
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
compiler: [vs, mingw]
build_type: [debug, release]
name: 🔲-${{ matrix.compiler }}-${{ matrix.build_type }}
steps:
- name: Устанавливаем MinGW
if: matrix.compiler == 'mingw'
uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-toolchain
- name: Добавляем в PATH путь к MinGW
if: matrix.compiler == 'mingw'
shell: bash
run: echo "${RUNNER_TEMP}/msys64/mingw64/bin" >> $GITHUB_PATH
- name: Скачиваем репозиторий
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
path: repo
- name: Генерируем проекты
shell: bash
run: |
args=(repo -B build)
if [ "${{ matrix.compiler }}" == "vs" ]
then
args+=(-G "Visual Studio 17 2022")
else
args+=(-G "MinGW Makefiles")
args+=(-D CMAKE_BUILD_TYPE=${{ matrix.build_type }})
fi
args+=(-D DV_ALL_WARNINGS=1 -D DV_CTEST=1)
cmake "${args[@]}"
- name: Компилируем
shell: bash
run: |
args=(--build build)
if [ "${{ matrix.compiler }}" == "vs" ]
then
args+=(--config ${{ matrix.build_type }})
fi
cmake "${args[@]}"
- name: Качаем Mesa
shell: bash
run: |
curl.exe --location --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/22.2.3/mesa3d-22.2.3-release-msvc.7z
7z x mesa.7z -omesa
rm mesa.7z
mv mesa/x64/libgallium_wgl.dll build/result
mv mesa/x64/libglapi.dll build/result
mv mesa/x64/opengl32.dll build/result
- name: CTest
shell: bash
run: |
args=(--verbose --test-dir build --timeout 60)
if [ "${{ matrix.compiler }}" == "vs" ]
then
args+=(-C ${{ matrix.build_type }})
fi
export LIBGL_ALWAYS_SOFTWARE=true
ctest "${args[@]}"