Windows Build #321
This file contains 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: Windows Build | |
on: | |
pull_request: | |
branches: | |
- stable | |
- unstable | |
schedule: | |
- cron: '0 23 * * 1' | |
push: | |
branches: | |
- stable | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
pre_job: | |
# continue-on-error: true # Uncomment once integration is finished | |
runs-on: ubuntu-latest | |
# Map a step output to a job output | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
# All of these options are optional, so you can remove them if you are happy with the defaults | |
cancel_others: 'true' | |
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | |
build: | |
name: ${{ matrix.config.name }} Python ${{ matrix.python-version }} | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
config: | |
- { | |
name: "Windows (MSVC)", | |
os: windows-latest, | |
build_type: "Release", | |
cc: "cl", | |
cxx: "cl", | |
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat", | |
generators: "Visual Studio 17 2022", | |
target: "ALL_BUILD" | |
} | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Print env | |
run: | | |
echo github.event.action: ${{ github.event.action }} | |
echo github.event_name: ${{ github.event_name }} | |
- name: Install dependencies on windows | |
run: | | |
choco install cmake ninja | |
ninja --version | |
cmake --version | |
- name: Install python pacakges | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install numpy pytest | |
- name: Configure | |
run: | | |
mkdir build | |
cd build | |
export PY_CMD=$(python -c 'import sys; print(sys.executable)') | |
cmake \ | |
-DCARMA_BUILD_TESTS=ON \ | |
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ | |
-DCMAKE_INSTALL_PREFIX:PATH=. \ | |
-DPython3_EXECUTABLE=${PY_CMD} \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ | |
-G "${{ matrix.config.generators }}" \ | |
.. | |
- name: Build | |
run: | | |
cd build | |
cmake \ | |
--build . \ | |
--target ${{ matrix.config.target }} \ | |
--config ${{ matrix.config.build_type }} | |
- name: Test | |
run: | | |
cd build | |
ctest \ | |
--verbose --rerun-failed --output-on-failure \ | |
-C ${{ matrix.config.build_type }} |