Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
csujedihy committed Jun 23, 2023
1 parent 84e637d commit c2ba226
Show file tree
Hide file tree
Showing 5 changed files with 411 additions and 407 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Windows
name: Build Unix

on:
workflow_dispatch:
Expand All @@ -7,51 +7,58 @@ on:
config:
required: false
default: 'Release'
options:
- Debug
- Release
type: string
# options:
# - Debug
# - Release
plat:
required: false
type: choice
type: string
default: 'linux'
options:
- linux
- android
- ios
- macos
# options:
# - linux
# - android
# - ios
# - macos
os:
required: false
type: choice
default: 'windows-2019'
options:
- ubuntu-20.04
- ubuntu-22.04
- macos-12
type: string
default: 'ubuntu-20.04'
# options:
# - ubuntu-20.04
# - ubuntu-22.04
# - macos-12
arch:
required: false
default: 'x64'
type: choice
options:
- x86
- x64
- arm64
type: string
# options:
# - x86
# - x64
tls:
required: false
default: 'schannel'
type: choice
options:
- openssl
- openssl3
- schannel
xdp:
type: string
# options:
# - openssl
# - openssl3
static:
required: false
default: ''
type: string
sanitize:
systemcrypto:
required: false
default: ''
type: string
static:
clang:
required: false
default: ''
type: string
codecheck:
required: false
default: ''
type: string
sanitize:
required: false
default: ''
type: string
Expand All @@ -63,43 +70,34 @@ on:
permissions: read-all

jobs:
build-windows:
if: inputs.plat == 'windows' || inputs.plat == 'uwp'
name: User Mode
needs: []
build-ubuntu-reuse:
if: inputs.plat == 'linux' || inputs.plat == 'android'
runs-on: ${{ inputs.os }}
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 0
- name: Install Perl
uses: shogo82148/actions-setup-perl@0bb5af61b3945a80585229183e7ac50a97d7996c
with:
perl-version: '5.34'
- name: Install NASM
uses: ilammy/setup-nasm@321e6ed62a1fc77024a3bd853deb33645e8b22c4
- name: Prepare Machine
shell: pwsh
run: scripts/prepare-machine.ps1 -ForBuild -Tls ${{ inputs.tls }}
- name: Build For Test
if: inputs.test == true
if: inputs.test == '-Test'
shell: pwsh
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} -DisableTools -DisablePerf -DynamicCRT ${{ inputs.xdp }} ${{ inputs.sanitize }}
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} -DisableTools -DisablePerf ${{ inputs.static }} ${{ inputs.clang }} ${{ inputs.systemcrypto }} ${{ inputs.codecheck }} ${{ inputs.sanitize }}
- name: Build
if: inputs.test == false
if: inputs.test == ''
shell: pwsh
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} ${{ inputs.xdp }} ${{ inputs.sanitize }} ${{ inputs.static }}
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} ${{ inputs.static }} ${{ inputs.clang }} ${{ inputs.codecheck }}
- name: Upload build artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}${{ inputs.xdp }}${{ inputs.sanitize }}${{ inputs.static }}
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}${{ inputs.static }}${{ inputs.clang }}${{ inputs.systemcrypto }}${{ inputs.codecheck }}${{ inputs.sanitize }}${{ inputs.test }}
path: artifacts

build-windows-kernel:
if: inputs.plat == 'winkernel'
name: Kernel Mode
needs: []
build-macOS-reuse:
name: Build
if: inputs.plat == 'macos' || inputs.plat == 'ios'
runs-on: ${{ inputs.os }}
steps:
- name: Checkout repository
Expand All @@ -108,20 +106,12 @@ jobs:
fetch-depth: 0
- name: Prepare Machine
shell: pwsh
run: scripts/prepare-machine.ps1 -ForBuild -ForKernel
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c
- name: Nuget Restore
shell: pwsh
run: msbuild msquic.kernel.sln -t:restore /p:RestorePackagesConfig=true /p:Configuration=${{ inputs.config }} /p:Platform=${{ inputs.arch }}
run: scripts/prepare-machine.ps1 -ForBuild -Tls ${{ inputs.tls }}
- name: Build
shell: pwsh
run: msbuild msquic.kernel.sln /p:Configuration=${{ inputs.config }} /p:Platform=${{ inputs.arch }} /p:QUIC_VER_SUFFIX=-official
- name: Sign Kernel
shell: pwsh
run: scripts/sign.ps1 -Config ${{ inputs.config }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }}
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} ${{ inputs.static }} ${{ inputs.sanitize }}
- name: Upload build artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}${{ inputs.static }}${{ inputs.sanitize }}${{ inputs.test }}
path: artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,50 @@ on:
config:
required: false
default: 'Release'
options:
- Debug
- Release
type: string
# options:
# - Debug
# - Release
plat:
required: false
type: choice
type: string
default: 'windows'
options:
- windows
- uwp
- winkernel
# options:
# - windows
# - uwp
# - winkernel
os:
required: false
type: choice
type: string
default: 'windows-2019'
options:
- windows-2019
- windows-2022
# options:
# - windows-2019
# - windows-2022
arch:
required: false
default: 'x64'
type: choice
options:
- x86
- x64
- arm64
type: string
# options:
# - x86
# - x64
# - arm64
tls:
required: false
default: 'schannel'
type: choice
options:
- openssl
- openssl3
- schannel
type: string
# options:
# - openssl
# - openssl3
# - schannel
xdp:
required: false
default: ''
type: string
sanitize:
static:
required: false
default: ''
type: string
static:
sanitize:
required: false
default: ''
type: string
Expand All @@ -61,10 +62,9 @@ on:
permissions: read-all

jobs:
build-windows:
build-windows-reuse:
if: inputs.plat == 'windows' || inputs.plat == 'uwp'
name: User Mode
needs: []
runs-on: ${{ inputs.os }}
steps:
- name: Checkout repository
Expand All @@ -81,23 +81,22 @@ jobs:
shell: pwsh
run: scripts/prepare-machine.ps1 -ForBuild -Tls ${{ inputs.tls }}
- name: Build For Test
if: inputs.test == true
if: inputs.test == '-Test'
shell: pwsh
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} -DisableTools -DisablePerf -DynamicCRT ${{ inputs.xdp }} ${{ inputs.sanitize }}
- name: Build
if: inputs.test == false
if: inputs.test == ''
shell: pwsh
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} ${{ inputs.xdp }} ${{ inputs.sanitize }} ${{ inputs.static }}
- name: Upload build artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}${{ inputs.xdp }}${{ inputs.sanitize }}${{ inputs.static }}
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}${{ inputs.xdp }}${{ inputs.sanitize }}${{ inputs.static }}${{ inputs.test }}
path: artifacts

build-windows-kernel:
build-windows-kernel-reuse:
if: inputs.plat == 'winkernel'
name: Kernel Mode
needs: []
runs-on: ${{ inputs.os }}
steps:
- name: Checkout repository
Expand All @@ -121,5 +120,5 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}${{ inputs.test }}
path: artifacts
Loading

0 comments on commit c2ba226

Please sign in to comment.