Skip to content

ci: build for Windows ARM64 #658

ci: build for Windows ARM64

ci: build for Windows ARM64 #658

Workflow file for this run

---
name: CI
permissions: {}
on:
pull_request:
push:
branches:
- master
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
setup_release:
name: Setup Release
outputs:
publish_release: ${{ steps.setup_release.outputs.publish_release }}
release_body: ${{ steps.setup_release.outputs.release_body }}
release_commit: ${{ steps.setup_release.outputs.release_commit }}
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
release_tag: ${{ steps.setup_release.outputs.release_tag }}
release_version: ${{ steps.setup_release.outputs.release_version }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Release
id: setup_release
uses: LizardByte/actions/actions/release_setup@70bb8d394d1c92f6113aeec6ae9cc959a5763d15 # v2026.227.200013
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build (${{ matrix.name }})
needs: setup_release
permissions:
contents: read
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
shell: bash
- name: macOS
os: macos-latest
shell: bash
- name: Windows-AMD64
os: windows-latest
shell: msys2 {0}
msystem: ucrt64
toolchain: ucrt-x86_64
- name: Windows-ARM64
os: windows-11-arm
shell: msys2 {0}
msystem: clangarm64
toolchain: clang-aarch64
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Setup Dependencies Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
ninja-build \
nlohmann-json3-dev
- name: Setup Dependencies macOS
if: runner.os == 'macOS'
run: |
brew update
brew install \
boost \
cmake \
doxygen \
graphviz \
nlohmann-json \
ninja \
node \
- name: Setup Dependencies Windows
if: runner.os == 'Windows'
uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.0
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
doxygen
mingw-w64-${{ matrix.toolchain }}-boost
mingw-w64-${{ matrix.toolchain }}-cmake
mingw-w64-${{ matrix.toolchain }}-graphviz
mingw-w64-${{ matrix.toolchain }}-ninja
mingw-w64-${{ matrix.toolchain }}-nodejs
mingw-w64-${{ matrix.toolchain }}-toolchain
mingw-w64-${{ matrix.toolchain }}-nlohmann-json
- name: Setup python
id: setup-python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- name: Python Path
id: python-path
env:
TMP_PYTHON_PATH: ${{ steps.setup-python.outputs.python-path }}
run: |
if [ "${RUNNER_OS}" == "Windows" ]; then
# replace backslashes with double backslashes
python_path=$(echo "${TMP_PYTHON_PATH}" | sed 's/\\/\\\\/g')
else
python_path="${TMP_PYTHON_PATH}"
fi
# step output
echo "python-path=${python_path}"
echo "python-path=${python_path}" >> "${GITHUB_OUTPUT}"
- name: Build
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }}
COMMIT: ${{ needs.setup_release.outputs.release_commit }}
run: |
mkdir -p build
if [ "${RUNNER_OS}" = "Linux" ]; then
# Doxygen from Ubuntu is too old, need Doxygen >= 1.10
DOCS=OFF
else
DOCS=ON
fi
cmake \
-DBUILD_DOCS=${DOCS} \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-B build \
-G Ninja \
-S .
ninja -C build
- name: Run tests
id: test
working-directory: build/tests
run: ./test_libdisplaydevice --gtest_color=yes --gtest_output=xml:test_results.xml
- name: Generate gcov report
id: test_report
# any except canceled or skipped
if: >-
always() &&
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
env:
PYTHON_PATH: ${{ steps.python-path.outputs.python-path }}
working-directory: build
run: |
"${PYTHON_PATH}" -m pip install "../scripts[test]"
"${PYTHON_PATH}" -m gcovr . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--verbose \
--xml-pretty \
-o coverage.xml
- name: Upload coverage artifact
if: >-
always() &&
(steps.test_report.outcome == 'success')
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: coverage-${{ matrix.name }}
path: |
build/coverage.xml
build/tests/test_results.xml
if-no-files-found: error
- name: Move Artifacts
run: |
mkdir -p artifacts
if [[ "${RUNNER_OS}" == "Windows" ]]; then
mv -f ./build/tests/test_libdisplaydevice.exe artifacts/
else
mv -f ./build/tests/test_libdisplaydevice artifacts/
fi
- name: Upload Artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: build-${{ matrix.name }}
path: artifacts/
if-no-files-found: error
coverage:
name: Coverage-${{ matrix.flag }}
if: >-
always() &&
(needs.build.result == 'success' || needs.build.result == 'failure') &&
startsWith(github.repository, 'LizardByte/')
needs: build
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- build_name: Linux
flag: Linux
- build_name: macOS
flag: macOS
- build_name: Windows-AMD64
flag: Windows-x64
- build_name: Windows-ARM64
flag: Windows-ARM64
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download coverage artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: coverage-${{ matrix.build_name }}
path: _coverage
- name: Debug coverage file
run: cat _coverage/coverage.xml
- name: Upload test coverage
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
disable_search: true
fail_ci_if_error: true
files: ./_coverage/coverage.xml
report_type: coverage
flags: ${{ matrix.flag }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Upload test results
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
disable_search: true
fail_ci_if_error: true
files: ./_coverage/tests/test_results.xml
report_type: test_results
flags: ${{ matrix.flag }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
release:
name: Release
if:
always() &&
needs.setup_release.outputs.publish_release == 'true' &&
needs.build.result == 'success' &&
startsWith(github.repository, 'LizardByte/')
needs:
- build
- setup_release
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Download build artifact (Windows-AMD64)
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-Windows-AMD64
path: build-Windows-AMD64
- name: Download build artifact (Windows-ARM64)
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-Windows-ARM64
path: build-Windows-ARM64
- name: Download build artifact (Linux)
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-Linux
path: build-Linux
- name: Download build artifact (macOS)
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-macOS
path: build-macOS
- name: Move artifacts
run: |
mkdir -p artifacts
mv -f build-Windows-AMD64/test_libdisplaydevice.exe artifacts/test_libdisplaydevice-Windows-AMD64.exe
mv -f build-Windows-ARM64/test_libdisplaydevice.exe artifacts/test_libdisplaydevice-Windows-ARM64.exe
mv -f build-Linux/test_libdisplaydevice artifacts/test_libdisplaydevice-Linux
mv -f build-macOS/test_libdisplaydevice artifacts/test_libdisplaydevice-macOS
- name: Create/Update GitHub Release
if: needs.setup_release.outputs.publish_release == 'true'
uses: LizardByte/actions/actions/release_create@70bb8d394d1c92f6113aeec6ae9cc959a5763d15 # v2026.227.200013
with:
allowUpdates: false
body: ${{ needs.setup_release.outputs.release_body }}
draft: true
generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }}
name: ${{ needs.setup_release.outputs.release_tag }}
prerelease: true
tag: ${{ needs.setup_release.outputs.release_tag }}
token: ${{ secrets.GH_BOT_TOKEN }}
virustotal_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}