update workflow to use windows 2022 image (#4580)

* update workflow to use windows 2022 image

* return the version of the run vcpkg action

the action has been changed to now use a vcpkg.json file instead of the
txt file we use now, we should try to find a way to update it to the new
workflow in case the current one becomes obsolete

* clean up a bit for consistency

* run ctest directly instead of relying on the makefile

* set -C flag for ctest

* set config option for cmake --build

this option is ignored for other platforms
This commit is contained in:
ebbit1q 2022-02-27 22:32:54 +01:00 committed by GitHub
parent 2a54e9d7d1
commit 92ed53e13a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 45 deletions

View file

@ -160,11 +160,11 @@ jobs:
if: matrix.package != 'skip'
shell: bash
env:
suffix: '-${{matrix.distro}}'
type: '${{matrix.package}}'
PACKAGE_SUFFIX: '-${{matrix.distro}}'
CPACK_GENERATOR: '${{matrix.package}}'
run: |
source .ci/docker.sh
RUN --server --release --package "$type" --suffix "$suffix"
RUN --server --release --package
- name: Upload artifact
if: matrix.package != 'skip'
@ -312,13 +312,13 @@ jobs:
env:
QT_VERSION: '5.15.2'
QT_ARCH: msvc2019${{matrix.append}}
CMAKE_GENERATOR: 'Visual Studio 16 2019'
QT_ARCH: msvc2022${{matrix.append}}
CMAKE_GENERATOR: 'Visual Studio 17 2022'
steps:
- name: Add msbuild to PATH
id: add-msbuild
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v1.1
- name: Checkout
uses: actions/checkout@v2
@ -347,32 +347,20 @@ jobs:
appendedCacheKey: ${{hashFiles('**/vcpkg.txt')}}
vcpkgTriplet: ${{matrix.triplet}}-windows
- name: Configure Cockatrice ${{matrix.arch}}-bit
shell: bash
run: |
mkdir -p build
cd build
export QTDIR="${{runner.workspace}}/Qt/${{env.QT_VERSION}}/${{env.QT_ARCH}}"
cmake .. -G "${{env.CMAKE_GENERATOR}}" -A "${{matrix.cmake}}" -DCMAKE_BUILD_TYPE="Release" -DWITH_SERVER=1 -DTEST=1
- name: Build Cockatrice ${{matrix.arch}}-bit
id: package
id: build
shell: bash
working-directory: build
run: |
cmake --build . --target package --config Release
../.ci/name_build.sh "-win${{matrix.arch}}"
- name: Run tests
shell: bash
working-directory: build
run: ctest -T Test -C Release
env:
PACKAGE_SUFFIX: '-win${{matrix.arch}}'
CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}'
CMAKE_GENERATOR_PLATFORM: '${{matrix.cmake}}'
run: ./.ci/compile.sh --server --release --test --package
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Windows-${{matrix.arch}}bit-installer
path: ./build/${{steps.package.outputs.name}}
path: ./build/${{steps.build.outputs.name}}
if-no-files-found: error
- name: Upload to release
@ -382,6 +370,6 @@ jobs:
GITHUB_TOKEN: ${{github.token}}
with:
upload_url: ${{needs.configure.outputs.upload_url}}
asset_path: ./build/${{steps.package.outputs.name}}
asset_name: ${{steps.package.outputs.name}}
asset_path: ./build/${{steps.build.outputs.name}}
asset_name: ${{steps.build.outputs.name}}
asset_content_type: application/octet-stream