Skip to content

Merge pull request #367 from reo7sp/api-10.3 #51

Merge pull request #367 from reo7sp/api-10.3

Merge pull request #367 from reo7sp/api-10.3 #51

Workflow file for this run

name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CMAKE_INSTALL_MESSAGE: NEVER
CMAKE_LOG_LEVEL: WARNING
MAKEFLAGS: --silent
jobs:
test-linux:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: docker/setup-buildx-action@v4
- name: Build Docker image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile
build-args: |
CMAKE_INSTALL_MESSAGE=NEVER
CMAKE_LOG_LEVEL=WARNING
MAKEFLAGS=--silent
load: true
tags: reo7sp/tgbot-cpp
cache-from: type=gha,scope=runtime
cache-to: type=gha,mode=max,scope=runtime
- name: Build test Docker image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile_test
build-args: |
CMAKE_INSTALL_MESSAGE=NEVER
CMAKE_LOG_LEVEL=WARNING
MAKEFLAGS=--silent
load: true
tags: reo7sp/tgbot-cpp-test
cache-from: type=gha,scope=test
cache-to: type=gha,mode=max,scope=test
- name: Test tgbot-cpp
run: |
docker run --name tgbot-cpp-coverage reo7sp/tgbot-cpp-test sh -eu -c '
make test-only
make coverage
'
docker cp tgbot-cpp-coverage:/usr/src/tgbot-cpp/build/Debug/coverage ./coverage
docker rm tgbot-cpp-coverage
- name: Test codegen
run: make docker-test-api-codegen
- name: Upload HTML coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: coverage
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage/coveralls.json
format: coveralls
test-windows:
runs-on: windows-2022
timeout-minutes: 30
env:
CMAKE_BUILD_ARGS: -- --quiet
POETRY_VIRTUALENVS_IN_PROJECT: "true"
steps:
- uses: actions/checkout@v6
- id: python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Cache Python tools
id: python-tools-cache
uses: actions/cache@v5
with:
path: .ci-tools
key: python-tools-windows-2022-${{ steps.python.outputs.python-version }}-clang-format-22.1.8-conan-2.31.1-poetry-2.4.1
- name: Cache Poetry environment
uses: actions/cache@v5
with:
path: .venv
key: poetry-${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock', 'pyproject.toml') }}
restore-keys: poetry-${{ runner.os }}-${{ steps.python.outputs.python-version }}-
- name: Cache Conan packages
uses: actions/cache@v5
with:
path: ~/.conan2/p
key: conan-windows-2022-2.31.1-cpp20-${{ hashFiles('conanfile.py') }}
restore-keys: conan-windows-2022-2.31.1-cpp20-
- uses: ilammy/msvc-dev-cmd@v1
- name: Install Python tools
if: steps.python-tools-cache.outputs.cache-hit != 'true'
shell: pwsh
run: |
python -m venv .ci-tools
.ci-tools/Scripts/python -m pip install --quiet --disable-pip-version-check "clang-format==22.1.8" "conan==2.31.1" "poetry==2.4.1"
- name: Add Python tools to PATH
shell: pwsh
run: Resolve-Path .ci-tools/Scripts | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Build tgbot-cpp
shell: bash
run: |
make build-with-test
make install-only
- name: Build examples
shell: bash
run: make examples
- name: Test tgbot-cpp
shell: bash
run: make test-only
- name: Test codegen
shell: bash
run: make test-api-codegen