Skip to content

Commit

Permalink
Fix Windows x86 CI (#360)
Browse files Browse the repository at this point in the history
* Fix Windows x86 CI
* Append cmake-extra options to samples


Co-authored-by: xiazhvera <[email protected]>
  • Loading branch information
graebm and xiazhvera authored Mar 24, 2022
1 parent 3223ce8 commit 43d8d1b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .builder/actions/build_samples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Builder
import os
import sys
import argparse


class BuildSamples(Builder.Action):
Expand All @@ -9,6 +10,11 @@ def run(self, env):
print('skip_samples is defined. Skipping samples...')
return

# parse extra cmake configs
parser = argparse.ArgumentParser()
parser.add_argument('--cmake-extra', action='append', default=[])
cmd_args = parser.parse_known_args(env.args.args)[0]

steps = []
samples = [
'samples/mqtt/basic_pub_sub',
Expand All @@ -28,6 +34,8 @@ def run(self, env):
f'-H{sample_path}',
f'-DCMAKE_PREFIX_PATH={env.install_dir}',
'-DCMAKE_BUILD_TYPE=RelWithDebInfo'])
# append extra cmake configs
steps[-1].extend(cmd_args.cmake_extra)
steps.append(['cmake',
'--build', build_path,
'--config', 'RelWithDebInfo'])
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,28 @@ jobs:
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF
windows-vs16:
windows:
runs-on: windows-latest
steps:
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
md D:\a\work
cd D:\a\work
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream
python builder.pyz build -p ${{ env.PACKAGE_NAME }}
windows-vs14:
runs-on: windows-latest
runs-on: windows-2019 # windows-2019 is last env with Visual Studio 2015 (v14.0)
strategy:
matrix:
arch: [x86, x64]
arch: [Win32, x64]
steps:
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.0
arch: ${{ matrix.arch }}
uwp: false
spectre: true
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
md D:\a\work
cd D:\a\work
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-Tv140 --cmake-extra=-A${{ matrix.arch }}
windows-no-cpu-extensions:
runs-on: windows-latest
Expand Down

0 comments on commit 43d8d1b

Please sign in to comment.