Skip to content

update

update #7

Workflow file for this run

# Copyright (c) the Dviglo project
# Copyright (c) 2008-2023 the Urho3D project
# License: MIT
name: CI/CD
on:
push:
pull_request:
jobs:
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
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
cmake "${ARGS[@]}"
- name: Компилируем
shell: bash
run: |
ARGS=(--build build)
if [ "${{ matrix.COMPILER }}" == "vs" ]
then
ARGS+=(--config ${{ matrix.BUILD_TYPE }})
fi
cmake "${ARGS[@]}"
- name: CTest
shell: bash {0}
run: |
ARGS=(--test-dir build --timeout 60)
if [ "${{ matrix.COMPILER }}" == "vs" ]
then
ARGS+=(-C ${{ matrix.BUILD_TYPE }})
fi
ctest "${ARGS[@]}"
EXIT_CODE=$?
if (( $EXIT_CODE != 0 ))
then
echo "$(cat D:/a/dviglo2d/big_int/build/Testing/Temporary/LastTest.log)"
exit $EXIT_CODE
fi
Linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
COMPILER:
- {
ID: gcc,
C: gcc-13,
CXX: g++-13,
}
- {
ID: clang,
C: clang-13,
CXX: clang++-13,
}
BUILD_TYPE:
- {
ID: dbg,
VALUE: Debug,
}
- {
ID: rel,
VALUE: Release,
}
name: 🐧-${{ matrix.COMPILER.ID }}-${{ matrix.BUILD_TYPE.ID }}
steps:
- name: Скачиваем репозиторий
uses: actions/checkout@v4
with:
fetch-depth: 0
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 }}
- name: Компилируем
run: |
cmake --build build
- name: CTest
shell: bash {0}
run: |
ctest --test-dir build --timeout 60
EXIT_CODE=$? # Exit code of the previous command
if (( $EXIT_CODE != 0 ))
then
echo "$(cat /home/runner/work/dviglo2d/big_num/build/Testing/Temporary/LastTest.log)"
exit $EXIT_CODE
fi