diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f0fff59..263ccad7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,7 @@ name: Windows Implementation Library CI +permissions: + contents: read on: pull_request: @@ -115,3 +117,14 @@ jobs: 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 + + # This is somewhat of a hack... The branch protection rules on GitHub "expand" jobs that have matrices into all + # "instances" that correspond with that matrix... To make CI requirements easier to manage, use 'needs' here as a way + # to "collapse" all of these "instantiations" into one job + wil_ci: + name: WIL CI Requirement + runs-on: windows-latest + needs: [ build_and_test, format ] + steps: + - name: Success + run: echo All CI checks passed! diff --git a/scripts/azure-pipelines.yml b/scripts/azure-pipelines.yml deleted file mode 100644 index 2334ec22..00000000 --- a/scripts/azure-pipelines.yml +++ /dev/null @@ -1,87 +0,0 @@ -# Windows Implementation Library Pipeline - -trigger: -- master - -jobs: -- job: CheckFormatting - - pool: - vmImage: 'windows-2022' - - steps: - - script: | - :: 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 ##vso[task.logissue type=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 ^` where '^' 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 - ) - displayName: 'Check Formatting of Changes' - -- job: BuildAndTest - timeoutInMinutes: 90 - - variables: - compilers: 'clang,msvc' - architectures: 'x86,x64' - buildTypes: 'debug,relwithdebinfo' - - strategy: - matrix: - ${{each compiler in split(variables.compilers, ',')}}: - ${{each arch in split(variables.architectures, ',')}}: - ${{each buildType in split(variables.buildTypes, ',')}}: - ${{compiler}}-${{arch}}-${{buildType}}: - compiler: ${{compiler}} - arch: ${{arch}} - build-type: ${{buildType}} - - pool: - vmImage: 'windows-2022' - - steps: - - script: | - choco upgrade llvm -y - if %ERRORLEVEL% NEQ 0 goto :eof - echo ##vso[task.setvariable variable=PATH]%PATH%;C:\Program Files\LLVM\bin - displayName: 'Install Clang' - condition: eq(variables['compiler'], 'clang') - - - script: | - call scripts\call-vcvars.cmd $(arch) - if %ERRORLEVEL% NEQ 0 goto :eof - - call scripts\init.cmd -c $(compiler) -b $(build-type) --fast - if %ERRORLEVEL% NEQ 0 goto :eof - - call scripts\build_all.cmd - displayName: 'Build $(compiler) $(arch)$(build-type)' - - - script: | - call scripts\call-vcvars.cmd $(arch) - set ASAN_WIN_CONTINUE_ON_INTERCEPTION_FAILURE=1 - 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 - displayName: 'Test $(compiler) $(arch)$(build-type)'