Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/nh-57056-cpp17-github-actions' i…
Browse files Browse the repository at this point in the history
…nto nh-57056-cpp17

# Conflicts:
#	.github/workflows/build-windows.yml
  • Loading branch information
alehandru committed Sep 12, 2023
2 parents a99c6c5 + 7321479 commit 7d25d40
Show file tree
Hide file tree
Showing 1,091 changed files with 3,368 additions and 18,702 deletions.
174 changes: 174 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
name: Build gRPC for Windows

on:
push:
branches: ['nh-57056-cpp17-github-actions-temp']

# Inputs for reusable workflow

workflow_call:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: string

# Inputs for manually triggered workflow

workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'

env:
VS_CMAKE_VERSION: '3.26'

jobs:
build:
strategy:
matrix:
arch: ['32','64']
configuration: ['Release', 'Debug']
fail-fast: false

runs-on: windows-latest

steps:
- name: Install NASM
run: |
choco install -y nasm
- name: Add NASM to PATH
shell: pwsh
run: |
echo "C:/Program Files/NASM/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: NASM version
run: |
nasm.exe --version
- name: CMake version installed with Visual Studio
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
ls "c:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/"
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: 32 bit - set environment variables
if: ${{ matrix.arch == '32' }}
shell: powershell
run: |
echo "PLATFORM=win32" >> $env:GITHUB_ENV
- name: 64 bit - set environment variables
if: ${{ matrix.arch == '64' }}
shell: powershell
run: |
echo "PLATFORM=x64" >> $env:GITHUB_ENV
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v3
with:
submodules: recursive

- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Build gRPC ${{ matrix.arch }} bit ( ${{ matrix.configuration }} )
working-directory: ${{ github.workspace }}/build_windows_${{ matrix.arch }}
shell: cmd
run: |
msbuild.exe -maxcpucount /t:Build /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ env.PLATFORM }} /fl /flp:logfile=build-${{ matrix.arch }}.${{ matrix.configuration }}.log;verbosity=diagnostic grpc.sln
- name: Upload artifacts for gRPC ${{ matrix.arch }} bit ( ${{ matrix.configuration }} )
uses: actions/upload-artifact@v3
with:
name: build_${{ matrix.arch }}_${{ matrix.configuration }}
retention-days: 1
path: |
${{ github.workspace }}\build_windows_${{ matrix.arch }}\**\*.lib
archive:
needs: build
runs-on: windows-latest

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v3
with:
submodules: recursive

- name: Create directories
shell: pwsh
run: |
mkdir -p ${{ github.workspace }}/temp/
mkdir -p ${{ github.workspace }}/temp/build_windows_32
mkdir -p ${{ github.workspace }}/temp/build_windows_64
- name: Download artifacts for gRPC 32 (Release)
uses: actions/download-artifact@v3
with:
name: build_32_Release
path: ${{ github.workspace }}/temp/build_windows_32
if-no-files-found: error

- name: Download artifacts for gRPC 32 (Debug)
uses: actions/download-artifact@v3
with:
name: build_32_Debug
path: ${{ github.workspace }}/temp/build_windows_32
if-no-files-found: error

- name: Download artifacts for gRPC 64 (Release)
uses: actions/download-artifact@v3
with:
name: build_64_Release
path: ${{ github.workspace }}/temp/build_windows_64
if-no-files-found: error

- name: Download artifacts for gRPC 64 (Debug)
uses: actions/download-artifact@v3
with:
name: build_64_Debug
path: ${{ github.workspace }}/temp/build_windows_64
if-no-files-found: error

- name: List artifacts
shell: pwsh
run: |
ls -R ${{ github.workspace }}/temp
- name: Determine version
shell: powershell
run: |
$version = "${{ github.sha }}".Substring(0,7)
echo "VERSION=$version" >> $env:GITHUB_ENV
- name: Create archive
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
$source = "${{ github.workspace }}\temp"
$destination = "${{ github.workspace }}"
.\create-grpc-archive.ps1 -Source $source -Destination $destination -Version ${{ env.VERSION }}
- name: Upload archive for gRPC
uses: actions/upload-artifact@v3
with:
name: grpc
path: |
${{ github.workspace }}\*.zip.${{ env.VERSION }}
2 changes: 1 addition & 1 deletion build_windows_32/ALL_BUILD.dir/nasm.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<NASM>
<OutputFormat>$(IntDir)%(FileName).obj</OutputFormat>
<Outputswitch>0</Outputswitch>
<CompilerNasm>C:/NASM/nasm.exe</CompilerNasm>
<CompilerNasm>nasm.exe</CompilerNasm>
<PackAlignmentBoundary>0</PackAlignmentBoundary>
<CommandLineTemplate>"%(CompilerNasm)" [AllOptions] [AdditionalOptions] "%(FullPath)"</CommandLineTemplate>
<ExecutionDescription>Assembling %(Filename)%(Extension)</ExecutionDescription>
Expand Down
59 changes: 1 addition & 58 deletions build_windows_32/ALL_BUILD.vcxproj

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions build_windows_32/ALL_BUILD.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<CustomBuild Include="$(SolutionDir)..\CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
</Project>
Loading

0 comments on commit 7d25d40

Please sign in to comment.