Ignore unknown pragmas warning #9818
Workflow file for this run
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 MSVC builds | |
on: | |
push: | |
paths-ignore: | |
- '.clang-format' | |
- '.mdl-styles' | |
- '*.md' | |
- 'docs/**' | |
- 'licenses/**' | |
- 'website/**' | |
pull_request: | |
paths-ignore: | |
- '.clang-format' | |
- '.mdl-styles' | |
- '*.md' | |
- 'docs/**' | |
- 'licenses/**' | |
- 'website/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
VCPKG_ROOT: C:\vcpkg | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
jobs: | |
build_windows_vs: | |
name: ${{ matrix.conf.name }} | |
runs-on: windows-2022 | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
conf: | |
- name: MS Clang/LLVM 64-bit | |
arch: x64 | |
max_warnings: 30 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Setup CMake | |
uses: lukka/get-cmake@v3.29.3 | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
vs-prerelease: true | |
msbuild-architecture: ${{ matrix.conf.arch }} | |
- name: Integrate packages | |
shell: pwsh | |
run: | | |
${{ env.VCPKG_ROOT }}\vcpkg.exe integrate install | |
if (-not $?) { throw "vcpkg failed to integrate packages" } | |
- name: Log environment | |
shell: pwsh | |
run: .\scripts\log-env.ps1 | |
- name: Run tests | |
shell: pwsh | |
run: | | |
cd vs | |
MSBuild -m dosbox.sln -t:tests:Rebuild -p:Configuration=Debug -p:Platform=${{ matrix.conf.arch }} | |
- name: Build | |
shell: pwsh | |
run: | | |
cd vs | |
MSBuild -m dosbox.sln -t:dosbox:Rebuild -p:Configuration=Debug -p:Platform=${{ matrix.conf.arch }} | Tee-Object build.log | |
- name: Summarize warnings | |
shell: pwsh | |
env: | |
MAX_WARNINGS: ${{ matrix.conf.max_warnings }} | |
run: python scripts\count-warnings.py -f --msclang vs\build.log | |
build_windows_vs_release: | |
name: ${{ matrix.conf.name }} | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
outputs: | |
dosbox_version: ${{ steps.set_dosbox_vers.outputs.dosbox_vers }} | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
conf: | |
- name: Release build (64-bit) | |
arch: x64 | |
vs-release-dirname: x64 | |
debugger: false | |
- name: Release build w/ debugger (64-bit) | |
arch: x64 | |
vs-release-dirname: x64 | |
debugger: true | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Setup CMake | |
uses: lukka/get-cmake@v3.29.3 | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
vs-prerelease: true | |
msbuild-architecture: ${{ matrix.conf.arch }} | |
- name: Integrate packages | |
shell: pwsh | |
run: | | |
${{ env.VCPKG_ROOT }}\vcpkg.exe integrate install | |
if (-not $?) { throw "vcpkg failed to integrate packages" } | |
- name: Log environment | |
shell: pwsh | |
run: .\scripts\log-env.ps1 | |
- name: Set version | |
id: set_dosbox_vers | |
shell: bash | |
run: | | |
set -x | |
GIT_HASH=$(./scripts/get-version.sh hash) | |
sed -i "s|BUILD_GIT_HASH \"git\"|BUILD_GIT_HASH \"$GIT_HASH\"|" src/platform/visualc/config.h | |
VERSION=$(./scripts/get-version.sh version-and-hash) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "dosbox_vers=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Enable the debugger in config.h | |
if: ${{ matrix.conf.debugger }} | |
shell: bash | |
run: | | |
set -x | |
sed -i "s|C_DEBUG.*|C_DEBUG 1|" src/platform/visualc/config.h | |
sed -i "s|C_HEAVY_DEBUG.*|C_HEAVY_DEBUG 1|" src/platform/visualc/config.h | |
- name: Build release | |
shell: pwsh | |
run: | | |
cd vs | |
MSBuild -m dosbox.sln -t:dosbox:Rebuild -p:Configuration=Release -p:Platform=${{ matrix.conf.arch }} | |
- name: Set packaging names | |
id: set_pkg_dir | |
shell: bash | |
run: | | |
echo "pkg_dir=dosbox-staging-windows-${{ matrix.conf.arch }}-${{ env.VERSION }}" >> $GITHUB_OUTPUT | |
- name: Package standard build | |
if: ${{ !matrix.conf.debugger }} | |
shell: bash | |
run: | | |
# Construct VC_REDIST_DIR | |
readonly VC_REDIST_BASE="C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC" | |
readonly VC_REDIST_VERSION="14.38.33135" | |
readonly VC_REDIST_CRT_VERSION="Microsoft.VC143.CRT" | |
export VC_REDIST_DIR="$VC_REDIST_BASE/$VC_REDIST_VERSION/${{ matrix.conf.arch }}/$VC_REDIST_CRT_VERSION" | |
find "$VC_REDIST_BASE" -maxdepth 3 -type d | |
# Package | |
./scripts/create-package.sh \ | |
-p msvc \ | |
vs/${{ matrix.conf.vs-release-dirname }}/Release \ | |
"${{ steps.set_pkg_dir.outputs.pkg_dir }}" | |
- name: Package the debugger | |
if: ${{ matrix.conf.debugger }} | |
shell: bash | |
run: | | |
set -x | |
mkdir -p ${{ steps.set_pkg_dir.outputs.pkg_dir }} | |
# Move the debugger build into the release area | |
readonly RELEASE_DIR=${{ matrix.conf.vs-release-dirname }}/Release | |
ls "vs/$RELEASE_DIR" | |
cp vs/$RELEASE_DIR/dosbox.exe ${{ steps.set_pkg_dir.outputs.pkg_dir }}/dosbox_with_debugger.exe | |
- name: Upload package | |
if: ${{ !matrix.conf.debugger }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.set_pkg_dir.outputs.pkg_dir }}-without-debugger | |
path: ${{ steps.set_pkg_dir.outputs.pkg_dir }} | |
overwrite: true | |
- name: Upload debugger artifact | |
if: ${{ matrix.conf.debugger }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.set_pkg_dir.outputs.pkg_dir }}-with-debugger | |
path: ${{ steps.set_pkg_dir.outputs.pkg_dir }}/dosbox_with_debugger.exe | |
overwrite: true | |
merge: | |
runs-on: ubuntu-latest | |
needs: build_windows_vs_release | |
steps: | |
- name: Merge x64 artifacts | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: dosbox-staging-windows-x64-${{ needs.build_windows_vs_release.outputs.dosbox_version }} | |
pattern: dosbox-staging-windows-x64-* | |
delete-merged: 'true' |