2020-12-23 11:31:16 +00:00
|
|
|
name: Windows
|
|
|
|
on:
|
|
|
|
push:
|
2022-12-12 23:50:58 +00:00
|
|
|
branches: [ master, 'client_release/**' ]
|
2020-12-23 11:31:16 +00:00
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
schedule:
|
|
|
|
- cron: '15 12 * * 0'
|
|
|
|
|
2022-10-13 23:30:13 +00:00
|
|
|
concurrency:
|
2022-06-25 11:25:13 +00:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-03-28 22:18:29 +00:00
|
|
|
env:
|
2022-04-09 14:11:45 +00:00
|
|
|
AWS_ACCESS_KEY_ID: ${{secrets.S3_ACCESS_KEY}}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{secrets.S3_SECRET_KEY}}
|
2022-03-28 22:18:29 +00:00
|
|
|
AWS_DEFAULT_REGION: us-west-2
|
|
|
|
|
2020-12-23 11:31:16 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-04-09 14:11:45 +00:00
|
|
|
name: ${{matrix.configuration}}-${{matrix.platform}}-${{matrix.type}}
|
2022-12-29 19:13:56 +00:00
|
|
|
runs-on: windows-2022
|
2020-12-23 11:31:16 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-04-09 14:11:45 +00:00
|
|
|
type: [libs-cmake, msbuild]
|
2021-09-10 08:29:40 +00:00
|
|
|
platform: [x64, ARM64]
|
2020-12-23 11:31:16 +00:00
|
|
|
configuration: [Release]
|
2021-09-10 08:29:40 +00:00
|
|
|
fail-fast: false
|
2020-12-23 11:31:16 +00:00
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
2022-10-13 23:30:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-02-17 20:29:36 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2020-12-23 11:31:16 +00:00
|
|
|
|
2021-04-12 16:03:26 +00:00
|
|
|
- name: Download OpenCppCoverage
|
2020-12-23 11:31:16 +00:00
|
|
|
uses: suisei-cn/actions-download-file@v1
|
2021-09-10 08:29:40 +00:00
|
|
|
if: success() && matrix.platform == 'x64'
|
2021-04-12 16:03:26 +00:00
|
|
|
id: DownloadOpenCppCoverage
|
2020-12-23 11:31:16 +00:00
|
|
|
with:
|
2021-04-12 16:03:26 +00:00
|
|
|
url: "https://opencppcoverage.gallerycdn.vsassets.io/extensions/opencppcoverage/opencppcoverageplugin/0.9.7.1/1581265346391/OpenCppCoverage-0.9.7.1.vsix"
|
2022-04-09 14:11:45 +00:00
|
|
|
target: ${{github.workspace}}\temp\
|
2020-12-23 11:31:16 +00:00
|
|
|
|
2021-04-12 16:03:26 +00:00
|
|
|
- name: Unzip OpenCppCoverage
|
2021-09-10 08:29:40 +00:00
|
|
|
if: success() && matrix.platform == 'x64'
|
2020-12-23 11:31:16 +00:00
|
|
|
uses: DuckSoft/extract-7z-action@v1.0
|
|
|
|
with:
|
2022-04-09 14:11:45 +00:00
|
|
|
pathSource: ${{github.workspace}}\temp\OpenCppCoverage-0.9.7.1.vsix
|
|
|
|
pathTarget: ${{github.workspace}}\temp\OpenCppCoverage
|
2020-12-23 11:31:16 +00:00
|
|
|
|
|
|
|
- name: Setup msbuild
|
|
|
|
uses: microsoft/setup-msbuild@v1
|
|
|
|
|
2022-03-28 22:18:29 +00:00
|
|
|
- name: Check if build is running from origin repo
|
2022-04-09 14:11:45 +00:00
|
|
|
if: ${{success() && env.AWS_ACCESS_KEY_ID != 0 && env.AWS_SECRET_ACCESS_KEY != 0}}
|
2022-03-28 22:18:29 +00:00
|
|
|
run: |
|
|
|
|
echo "VCPKG_BINARY_SOURCES=clear;x-aws,s3://vcpkg.cache.boinc/,readwrite" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
|
|
|
|
|
|
|
- name: Check if build is running from fork
|
2022-04-09 14:11:45 +00:00
|
|
|
if: ${{success() && (env.AWS_ACCESS_KEY_ID == 0 || env.AWS_SECRET_ACCESS_KEY == 0)}}
|
2022-03-28 22:18:29 +00:00
|
|
|
run: |
|
|
|
|
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc/,read" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
|
|
|
|
2020-12-23 11:31:16 +00:00
|
|
|
- name: Fix vcpkg
|
|
|
|
run: vcpkg.exe integrate remove
|
|
|
|
|
|
|
|
- name: Cache dependencies
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/cache@v3
|
2020-12-23 11:31:16 +00:00
|
|
|
with:
|
|
|
|
path: |
|
2022-04-09 14:11:45 +00:00
|
|
|
${{github.workspace}}\3rdParty\Windows\cuda\
|
2022-12-29 19:13:56 +00:00
|
|
|
key: windows-${{matrix.platform}}-${{matrix.configuration}}-${{hashFiles('win_build/vcpkg_3rdparty_dependencies.vcxproj', '.github/workflows/windows.yml')}}
|
2020-12-23 11:31:16 +00:00
|
|
|
|
|
|
|
- name: Build
|
2022-04-09 14:11:45 +00:00
|
|
|
if: success() && matrix.type == 'msbuild'
|
2022-12-29 19:13:56 +00:00
|
|
|
run: msbuild win_build\boinc.sln -p:Configuration=${{matrix.configuration}} -p:Platform=${{matrix.platform}} -p:VcpkgTripletConfig=ci -m
|
2022-04-09 14:11:45 +00:00
|
|
|
|
|
|
|
- name: Build CMake
|
|
|
|
if: success() && matrix.type == 'libs-cmake'
|
|
|
|
run: windows\ci_build_libs_cmake.bat ${{matrix.platform}} ${{matrix.configuration}}
|
2020-12-23 11:31:16 +00:00
|
|
|
|
|
|
|
- name: Run tests
|
2022-04-09 14:11:45 +00:00
|
|
|
if: success() && matrix.platform == 'x64' && matrix.type == 'msbuild'
|
|
|
|
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
|
2020-12-23 11:31:16 +00:00
|
|
|
|
2021-04-26 15:58:02 +00:00
|
|
|
- name: Prepare logs on failure
|
2022-04-09 14:11:45 +00:00
|
|
|
if: ${{failure()}}
|
2021-06-09 16:34:44 +00:00
|
|
|
run: |
|
2022-06-25 14:51:16 +00:00
|
|
|
python ./deploy/prepare_deployment.py logs
|
2021-08-11 00:23:43 +00:00
|
|
|
|
2021-04-26 15:58:02 +00:00
|
|
|
- name: Upload logs on failure
|
2022-04-09 14:11:45 +00:00
|
|
|
if: ${{failure()}}
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-04-26 15:58:02 +00:00
|
|
|
with:
|
2022-04-09 14:11:45 +00:00
|
|
|
name: windows_logs_${{matrix.type}}_${{github.event.pull_request.head.sha}}
|
2021-04-26 15:58:02 +00:00
|
|
|
path: deploy/logs.7z
|
|
|
|
|
2021-04-27 13:31:14 +00:00
|
|
|
- name: Prepare artifacts for deploy
|
2022-04-09 14:11:45 +00:00
|
|
|
if: success() && matrix.type == 'msbuild'
|
2020-12-23 11:31:16 +00:00
|
|
|
shell: cmd
|
2021-08-11 00:23:43 +00:00
|
|
|
run: |
|
|
|
|
python deploy\prepare_deployment.py win_apps
|
|
|
|
python deploy\prepare_deployment.py win_client
|
|
|
|
python deploy\prepare_deployment.py win_manager
|
2022-03-28 22:18:29 +00:00
|
|
|
|
2021-08-11 00:23:43 +00:00
|
|
|
- name: Upload apps
|
2022-04-09 14:11:45 +00:00
|
|
|
if: success() && matrix.type == 'msbuild'
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-04 13:02:50 +00:00
|
|
|
with:
|
2022-04-09 14:11:45 +00:00
|
|
|
name: win_apps_${{matrix.platform}}_${{github.event.pull_request.head.sha}}
|
2021-08-11 00:23:43 +00:00
|
|
|
path: deploy/win_apps.7z
|
2022-03-28 22:18:29 +00:00
|
|
|
|
2021-08-11 00:23:43 +00:00
|
|
|
- name: Upload client
|
2022-04-09 14:11:45 +00:00
|
|
|
if: success() && matrix.type == 'msbuild'
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-04 13:02:50 +00:00
|
|
|
with:
|
2022-04-09 14:11:45 +00:00
|
|
|
name: win_client_${{matrix.platform}}_${{github.event.pull_request.head.sha}}
|
2021-08-11 00:23:43 +00:00
|
|
|
path: deploy/win_client.7z
|
2022-03-28 22:18:29 +00:00
|
|
|
|
2021-08-11 00:23:43 +00:00
|
|
|
- name: Upload manager
|
2022-04-09 14:11:45 +00:00
|
|
|
if: success() && matrix.type == 'msbuild'
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-04 13:02:50 +00:00
|
|
|
with:
|
2022-04-09 14:11:45 +00:00
|
|
|
name: win_manager_${{matrix.platform}}_${{github.event.pull_request.head.sha}}
|
2021-08-11 00:23:43 +00:00
|
|
|
path: deploy/win_manager.7z
|
2022-03-28 22:18:29 +00:00
|
|
|
|
2022-02-16 16:22:00 +00:00
|
|
|
- name: Upload symbol files
|
2022-10-13 23:30:13 +00:00
|
|
|
if: success() && matrix.type == 'msbuild'
|
|
|
|
uses: actions/upload-artifact@v3
|
2022-02-16 16:22:00 +00:00
|
|
|
with:
|
2022-04-09 14:11:45 +00:00
|
|
|
name: win_pdb_${{matrix.platform}}_${{github.event.pull_request.head.sha}}
|
|
|
|
path: win_build/Build/${{matrix.platform}}/${{matrix.configuration}}/*.pdb
|
2021-08-02 19:23:20 +00:00
|
|
|
|
|
|
|
- name: Upload Google Tests Results
|
2022-04-09 14:11:45 +00:00
|
|
|
if: always() && matrix.platform == 'x64' && matrix.type == 'msbuild'
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-08-02 19:23:20 +00:00
|
|
|
with:
|
|
|
|
name: Windows_tests_results
|
2022-04-09 14:11:45 +00:00
|
|
|
path: "win_build/Build/${{matrix.platform}}/${{matrix.configuration}}/**/gtest.xml"
|
2021-08-02 19:23:20 +00:00
|
|
|
|
2021-04-12 16:03:26 +00:00
|
|
|
- name: Upload coverage report
|
2022-04-09 14:11:45 +00:00
|
|
|
if: success() && matrix.platform == 'x64' && matrix.type == 'msbuild'
|
2022-04-05 14:34:09 +00:00
|
|
|
uses: codecov/codecov-action@v3
|
2021-04-12 16:03:26 +00:00
|
|
|
with:
|
|
|
|
fail_ci_if_error: true
|
|
|
|
verbose: false
|