boinc/.github/workflows/windows.yml

93 lines
3.4 KiB
YAML

name: Windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '15 12 * * 0'
jobs:
build:
name: ${{ matrix.configuration }}-${{ matrix.platform }}-build
runs-on: windows-latest
strategy:
matrix:
platform: [x64]
configuration: [Release]
env:
VCPKG_BINARY_SOURCES: 'clear;files,${{ github.workspace }}\3rdParty\buildCache\windows\vcpkgcache\,readwrite'
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Download OpenCppCoverage
uses: suisei-cn/actions-download-file@v1
id: DownloadOpenCppCoverage
with:
url: "https://opencppcoverage.gallerycdn.vsassets.io/extensions/opencppcoverage/opencppcoverageplugin/0.9.7.1/1581265346391/OpenCppCoverage-0.9.7.1.vsix"
target: ${{ github.workspace }}\temp\
- name: Unzip OpenCppCoverage
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: ${{ github.workspace }}\temp\OpenCppCoverage-0.9.7.1.vsix
pathTarget: ${{ github.workspace }}\temp\OpenCppCoverage
- name: Setup msbuild
uses: microsoft/setup-msbuild@v1
- name: Fix vcpkg
run: vcpkg.exe integrate remove
- name: Cache dependencies
uses: actions/cache@v2.1.3
with:
path: |
${{ github.workspace }}\3rdParty\buildCache\windows\vcpkgcache\
${{ github.workspace }}\3rdParty\Windows\cuda\
key: windows-${{ matrix.platform }}-${{ matrix.configuration }}-${{ hashFiles('win_build/vcpkg_3rdparty_dependencies_vs2019.vcxproj') }}
restore-keys: windows-${{ matrix.platform }}-${{ matrix.configuration }}-
- name: Build
run: msbuild win_build\boinc_vs2019.sln -p:Configuration=${{ matrix.configuration }} -p:Platform=${{ matrix.platform }} -p:VcpkgTripletConfig=ci -m
- name: Run tests
working-directory: win_build\Build\${{ matrix.platform }}\${{ matrix.configuration }}
run: ${{ github.workspace }}\temp\OpenCppCoverage\OpenCppCoverage-x64\OpenCppCoverage.exe --cover_children --optimized_build --sources ${{ github.workspace }} --export_type=cobertura:cobertura.xml -- unittests.exe --gtest_output=xml:gtest.xml
- name: Deploy to BinTray
if: ${{ success() }}
env:
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
PULL_REQUEST: ${{ github.event.number }}
PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
platform: ${{ matrix.platform }}
configuration: ${{ matrix.configuration }}
shell: cmd
run: |
call deploy\prepare_deployment.bat
call deploy\deploy_to_bintray.bat
- uses: actions/upload-artifact@v2
with:
name: win_apps_${{ github.event.pull_request.head.sha }}
path: deploy/win_apps/*.7z
- uses: actions/upload-artifact@v2
with:
name: win_client_${{ github.event.pull_request.head.sha }}
path: deploy/win_client/*.7z
- uses: actions/upload-artifact@v2
with:
name: win_manager_${{ github.event.pull_request.head.sha }}
path: deploy/win_manager/*.7z
- name: Upload coverage report
uses: codecov/codecov-action@v1
if: success()
with:
fail_ci_if_error: true
verbose: false