-
Notifications
You must be signed in to change notification settings - Fork 267
131 lines (125 loc) · 3.98 KB
/
Copy pathtest.yml
File metadata and controls
131 lines (125 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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