-
Notifications
You must be signed in to change notification settings - Fork 266
96 lines (92 loc) · 2.87 KB
/
Copy pathtest.yml
File metadata and controls
96 lines (92 loc) · 2.87 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
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
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
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
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: make docker-test-only
- name: Test codegen
run: make docker-test-api-codegen
test-windows:
runs-on: windows-2022
timeout-minutes: 30
env:
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 "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