Repository navigation
Fix windows build #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Cache Python tools | |
| id: pip-cache | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: ${{ runner.temp }}/pip-cache | |
| key: pip-windows-2022-x64-python-3.12-conan-2.31.1-poetry-2.4.1 | |
| - name: Cache Conan packages | |
| id: conan-cache | |
| uses: actions/cache/restore@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- | |
| - name: Cache Poetry environment | |
| id: poetry-cache | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: .venv | |
| key: poetry-${{ runner.os }}-3.12-${{ hashFiles('poetry.lock', 'pyproject.toml') }} | |
| restore-keys: poetry-${{ runner.os }}-3.12- | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Install tools | |
| shell: pwsh | |
| env: | |
| PIP_CACHE_DIR: ${{ runner.temp }}/pip-cache | |
| run: | | |
| choco install make --no-progress --yes | |
| python -m pip install "conan==2.31.1" "poetry==2.4.1" | |
| - name: Build | |
| shell: bash | |
| env: | |
| CONAN_BUILD_ARGS: --build=missing -s compiler.cppstd=20 -c tools.cmake.cmaketoolchain:generator=Ninja | |
| run: make build-with-test | |
| - name: Test tgbot-cpp | |
| shell: bash | |
| run: make test-only | |
| - name: Save Conan packages | |
| if: ${{ always() && steps.conan-cache.outputs.cache-hit != 'true' }} | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: ~/.conan2/p | |
| key: ${{ steps.conan-cache.outputs.cache-primary-key }} | |
| - name: Save Python tools | |
| if: ${{ always() && steps.pip-cache.outputs.cache-hit != 'true' }} | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: ${{ runner.temp }}/pip-cache | |
| key: ${{ steps.pip-cache.outputs.cache-primary-key }} | |
| - name: Save Poetry environment | |
| if: ${{ always() && steps.poetry-cache.outputs.cache-hit != 'true' }} | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: .venv | |
| key: ${{ steps.poetry-cache.outputs.cache-primary-key }} |