/
githubmirror
/
libusb
Обзор
Документация
Войти
/
githubmirror
/
libusb
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
.github/workflows/windows.yml
153 строки
7 KB
Ihor Dutchak
ci: reduce redundant Windows CI builds (#1879)
18 июл 2026, 22:02
Не верифицирован
18 июл 2026, 22:02
9f952b0
Код
Авторство
О чём код?
name: Windows on: push: branches: - master tags: - '**' pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: build: name: >- ${{ matrix.compiler.job_label }} | ${{ matrix.architecture }} | ${{ matrix.configuration_family.label }} strategy: fail-fast: false # Leave runner capacity for the Linux, macOS, and MSYS2 workflows. max-parallel: 18 matrix: compiler: - runner: windows-2022 job_label: W-2022 | VS 2022 | v143 toolset: v143 artifact_prefix: build-windows-2022 - runner: windows-2025-vs2026 job_label: W-2025 | VS 2026 | v145 toolset: v145 # Retain the established artifact names despite using the explicit # VS 2026 runner label. artifact_prefix: build-windows-2025 configuration_family: - label: Debug + Release first: Debug second: Release - label: Debug-MT + Release-MT first: Debug-MT second: Release-MT - label: Debug-Hotplug + Release-Hotplug first: Debug-Hotplug second: Release-Hotplug - label: Debug-Hotplug-MT + Release-Hotplug-MT first: Debug-Hotplug-MT second: Release-Hotplug-MT architecture: - Win32 - x64 - ARM64 include: # VS 2022 hosts the VS 2019-era v142 toolset. Pairing Debug and # Release keeps the four v142 builds in two clearly named jobs. - compiler: runner: windows-2022 job_label: W-2022 | VS 2022 | v142 (VS 2019) toolset: v142 artifact_prefix: build-windows-2022-v142 configuration_family: label: Debug + Release first: Debug second: Release architecture: Win32 - compiler: runner: windows-2022 job_label: W-2022 | VS 2022 | v142 (VS 2019) toolset: v142 artifact_prefix: build-windows-2022-v142 configuration_family: label: Debug + Release first: Debug second: Release architecture: x64 runs-on: ${{ matrix.compiler.runner }} timeout-minutes: 60 steps: - name: Checkout code uses: actions/checkout@v6 with: # Full history + tags so the MSVC PreBuildEvent's call to # build-aux/gen-describe.ps1 can produce a tag-prefixed # `git describe` string. fetch-depth: 0 - name: Setup MSBuild uses: microsoft/setup-msbuild@v3 - name: Build ${{ matrix.configuration_family.first }} id: first_build continue-on-error: true run: >- msbuild msvc/libusb.sln /m -property:Configuration=${{ matrix.configuration_family.first }} -property:Platform=${{ matrix.architecture }} -property:PlatformToolset=${{ matrix.compiler.toolset }} - name: Build ${{ matrix.configuration_family.second }} id: second_build if: ${{ !cancelled() && steps.first_build.outcome != 'skipped' }} continue-on-error: true run: >- msbuild msvc/libusb.sln /m -property:Configuration=${{ matrix.configuration_family.second }} -property:Platform=${{ matrix.architecture }} -property:PlatformToolset=${{ matrix.compiler.toolset }} - name: Upload ${{ matrix.configuration_family.first }} artifacts if: ${{ !cancelled() && steps.first_build.outcome == 'success' }} uses: actions/upload-artifact@v7 with: name: ${{ matrix.compiler.artifact_prefix }}-${{ matrix.configuration_family.first }}-${{ matrix.architecture }} if-no-files-found: error path: | build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.first }}/**/*.exe build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.first }}/dll/libusb-1.0.dll build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.first }}/dll/libusb-1.0.lib build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.first }}/dll/libusb-1.0.exp build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.first }}/dll/libusb-1.0.pdb build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.first }}/lib/libusb-1.0.lib build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.first }}/lib/libusb-1.0.pdb - name: Upload ${{ matrix.configuration_family.second }} artifacts if: ${{ !cancelled() && steps.second_build.outcome == 'success' }} uses: actions/upload-artifact@v7 with: name: ${{ matrix.compiler.artifact_prefix }}-${{ matrix.configuration_family.second }}-${{ matrix.architecture }} if-no-files-found: error path: | build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.second }}/**/*.exe build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.second }}/dll/libusb-1.0.dll build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.second }}/dll/libusb-1.0.lib build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.second }}/dll/libusb-1.0.exp build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.second }}/dll/libusb-1.0.pdb build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.second }}/lib/libusb-1.0.lib build/${{ matrix.compiler.toolset }}/${{ matrix.architecture }}/${{ matrix.configuration_family.second }}/lib/libusb-1.0.pdb - name: Check build results if: ${{ always() }} shell: pwsh env: FIRST_CONFIGURATION: ${{ matrix.configuration_family.first }} FIRST_OUTCOME: ${{ steps.first_build.outcome }} SECOND_CONFIGURATION: ${{ matrix.configuration_family.second }} SECOND_OUTCOME: ${{ steps.second_build.outcome }} run: | if ($env:FIRST_OUTCOME -ne 'success' -or $env:SECOND_OUTCOME -ne 'success') { throw "Build results: $env:FIRST_CONFIGURATION=$env:FIRST_OUTCOME, $env:SECOND_CONFIGURATION=$env:SECOND_OUTCOME" }