Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Windows CI and Conan Usage #4513

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ env:
C2_ENABLE_LTO: ${{ github.ref == 'refs/heads/master' }}
CHATTERINO_REQUIRE_CLEAN_GIT: On
C2_BUILD_WITH_QT6: Off
# Last known good conan version
# 2.0.3 has a bug on Windows (conan-io/conan#13606)
CONAN_VERSION: 2.0.2

jobs:
build:
Expand Down Expand Up @@ -117,32 +120,30 @@ jobs:
version: ${{ matrix.qt-version }}

# WINDOWS
- name: Enable Developer Command Prompt (Windows)
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.12.1

- name: Setup conan variables (Windows)
if: startsWith(matrix.os, 'windows')
run: |
"C2_USE_OPENSSL3=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "True" } else { "False" })" >> "$Env:GITHUB_ENV"
"C2_CONAN_CACHE_SUFFIX=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "-QT6" } else { "`" })" >> "$Env:GITHUB_ENV"
shell: powershell

- name: Cache conan packages
- name: Cache conan packages (Windows)
if: startsWith(matrix.os, 'windows')
uses: actions/cache@v3
with:
key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.py') }}${{ env.C2_CONAN_CACHE_SUFFIX }}
path: ~/.conan2/

- name: Add Conan to path
if: startsWith(matrix.os, 'windows')
run: echo "C:\Program Files\Conan\conan\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Install dependencies (Windows)
- name: Install Conan (Windows)
if: startsWith(matrix.os, 'windows')
run: |
choco install conan -y

- name: Enable Developer Command Prompt
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.12.1
python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$GITHUB_PATH"
pip3 install --user "conan==${{ env.CONAN_VERSION }}"
shell: powershell

- name: Setup Conan (Windows)
if: startsWith(matrix.os, 'windows')
Expand All @@ -151,7 +152,7 @@ jobs:
conan profile detect -f
shell: powershell

- name: Build (Windows)
- name: Install dependencies (Windows)
if: startsWith(matrix.os, 'windows')
run: |
mkdir build
Expand All @@ -162,6 +163,12 @@ jobs:
-b missing `
--output-folder=. `
-o with_openssl3="$Env:C2_USE_OPENSSL3"
shell: powershell

- name: Build (Windows)
if: startsWith(matrix.os, 'windows')
run: |
cd build
cmake `
-G"NMake Makefiles" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
Expand Down