Skip to content

Test: Transitioning from ADO to Github Actions for CI #6

Test: Transitioning from ADO to Github Actions for CI

Test: Transitioning from ADO to Github Actions for CI #6

Workflow file for this run

name: Windows Implementation Library CI
on:
pull_request:
push:
branches:
- master
jobs:
format:
name: Format Check
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Formatting
shell: cmd
run: |
REM The architecture is not important; we just need VCINSTALLDIR set
call scripts\call-vcvars.cmd x64
call scripts\format-changes.cmd origin/master
if %ERRORLEVEL% neq 0 (
echo ::error::ERROR: This branch contains changes that have not been formatted with 'clang-format'
echo NOTE: To resolve this issue, you can run 'clang-format' in the following ways:
echo * Run `scripts/format-changes.cmd ^<branch^>` where '^<branch^>' is either 'origin/master' or 'upstream/master'
echo depending on whether or not this is a fork. This will only format the changes you made relative to the
echo master branch in the 'microsoft/wil' repo.
echo * Run `scripts/run-clang-format.cmd` which will run 'clang-format' on _all_ source files. This script is
echo simpler to run, however there's a chance it may touch additional files you never changed due to you having
echo a mis-matched version of 'clang-format'. This may require you to manually revert changes made by
echo 'clang-format' to the locations where you made no code changes.
echo * Build the 'format' target ^(e.g. `ninja format`^). This is equivalent to running the second option above.
echo.
echo For more information, please see https://github.com/microsoft/wil?tab=readme-ov-file#formatting
echo.
echo NOTE: As an additional note, given that different versions of 'clang-format' may have different behaviors, this
echo may be a false positive. If you believe that to be the case ^(e.g. none of the above resulted in modifications
echo to the code you have changed^), please note this in your PR.
echo ----------------------------------------------
echo See below for the file^(s^) that have changed:
git diff
exit /b 1
)
build_and_test:
name: Build and Test
strategy:
matrix:
host: [ windows-latest, windows-11-arm ]
arch: [ x64, x64_x86, arm64 ]
compiler: [ msvc, clang ]
config: [ debug, relwithdebinfo ]
exclude:
- host: windows-latest
arch: arm64
- host: windows-11-arm
arch: x64
- host: windows-11-arm
arch: x64_x86
runs-on: ${{matrix.host}}
steps:
- uses: actions/checkout@v4
- name: Install/Update Clang
if: matrix.compiler == 'clang'
shell: cmd
run: |
choco upgrade llvm -y
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
echo C:\Program Files\LLVM\bin >> %GITHUB_PATH%
- name: Initialize CMake
shell: cmd
run: |
call scripts\call-vcvars.cmd ${{matrix.arch}}
if %ERRORLEVEL% NEQ 0 goto :eof
echo %PATH%
call scripts\init.cmd -c ${{matrix.compiler}} -b ${{matrix.config}}
- name: Build Tests
shell: cmd
run: |
call scripts\call-vcvars.cmd ${{matrix.arch}}
if %ERRORLEVEL% NEQ 0 goto :eof
call scripts\build_all.cmd
- name: Run Tests
shell: cmd
run: |
call scripts\call-vcvars.cmd ${{matrix.arch}}
if %ERRORLEVEL% NEQ 0 goto :eof
REM NOTE: You can add '-s' to display detailed information about passing assertions, which can be helpful for diagnosing
REM hanging tests, however the callstack logic has mostly rendered this unnecssary for most scenarios.
REM That said, we do pass '-d yes' so that it's easier to see which tests were run immediately before a hanging/crashing test
call scripts\runtests.cmd ~[LocalOnly] -d yes