Skip to content

Commit 5f371e6

Browse files
committed
fix(ci): add Windows compatibility for build-test workflow
- Fix CONAN_HOME path to use github.workspace instead of ~ - Add shell: bash to all Unix-style command steps - Add jq installation for Windows via chocolatey - Fix test_package execution to use 'conan test' command
1 parent 1054372 commit 5f371e6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/ci-build-test.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ main ]
88

99
env:
10-
CONAN_HOME: ~/.conan2
10+
CONAN_HOME: ${{ github.workspace }}/.conan2
1111

1212
jobs:
1313
build-and-test:
@@ -34,16 +34,25 @@ jobs:
3434
python-version: '3.12'
3535

3636
- name: Install Conan
37+
shell: bash
3738
run: |
3839
pip install conan
3940
41+
- name: Install jq (Windows)
42+
if: matrix.os == 'windows-latest'
43+
shell: bash
44+
run: |
45+
choco install jq -y
46+
4047
- name: Get package name
4148
id: read_meta
49+
shell: bash
4250
run: |
4351
pkg_name=$(jq -r '.name | tostring' metadata.json)
4452
echo "pkg_name=$pkg_name" >> $GITHUB_OUTPUT
4553
4654
- name: Configure Conan
55+
shell: bash
4756
run: |
4857
echo "CONAN_HOME=${{ env.CONAN_HOME }}" >> $GITHUB_ENV
4958
conan profile detect --force
@@ -62,15 +71,18 @@ jobs:
6271
conan-${{ runner.os }}-
6372
6473
- name: Build and test with Conan
74+
shell: bash
6575
run: |
6676
conan create . -pr:b=default -pr:h=default -s build_type=${{ matrix.build_type }} --build=missing
6777
timeout-minutes: 30
6878

6979
- name: Clean up test_package builds
80+
shell: bash
7081
run: |
71-
python ./test_package/conanfile.py
82+
conan test . test_package --build=missing
7283
7384
- name: Clean up Conan packages
7485
if: always()
86+
shell: bash
7587
run: |
7688
conan remove "${{ steps.read_meta.outputs.pkg_name }}/*" --confirm

0 commit comments

Comments
 (0)