Skip to content

Commit

Permalink
Merge branch 'feature/testcase-enhancement' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
kekyo committed Jun 12, 2022
2 parents cae9c00 + 59075af commit 2802237
Show file tree
Hide file tree
Showing 292 changed files with 5,231 additions and 3,536 deletions.
131 changes: 94 additions & 37 deletions .github/workflows/build-linux.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
name: Linux
on:
push:
branches:
- master
- devel
- feature/github-actions-2
pull_request:
branches:
- master
- devel
workflow_dispatch:
branches:
on: [push]
permissions:
contents: read
jobs:
Expand All @@ -23,55 +12,123 @@ jobs:
env:
buildConfiguration: ${{ matrix.buildConfiguration }}
steps:

#----------------------------------------------------------------------

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
# https://stackoverflow.com/questions/61463578/github-actions-actions-checkoutv2-lfs-true-flag-not-converting-pointers-to-act

- name: Checkout LFS objects
run: git lfs checkout
- name: Setup .NET Core 2.1

- name: Extract branch name
id: extract_branch_name
run: |
export branch_name=`git name-rev --name-only --exclude=tags/* HEAD`
echo "Detected current branch: $branch_name"
echo "::set-output name=branch_name::$branch_name"
#----------------------------------------------------------------------

- name: Setup .NET Core 2.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.818
dotnet-version: 2.2.*
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.414
dotnet-version: 3.1.*
- name: Setup .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.402
dotnet-version: 5.0.*
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100
dotnet-version: 6.0.*

#----------------------------------------------------------------------

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

#- name: Setup NuGet CLI
# uses: nuget/setup-nuget@v1

#----------------------------------------------------------------------

#- name: Initialize tools
# run: bash .github/workflows/init-tools-on-ga.sh
- name: Install dependencies
run: |
dotnet restore il2c.sln
dotnet restore samples/Calculator/Calculator.Core/Calculator.Core.csproj
# dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln
# dotnet restore samples/Calculator/Calculator.sln

#----------------------------------------------------------------------

- name: Build runtime library
run: bash build-runtime.sh ${{env.buildConfiguration}}

#----------------------------------------------------------------------

- name: Build il2c
run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform="Any CPU" il2c.sln
# - name: Build GettingStartedIL2C-x86
# run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln
# - name: Build GettingStartedIL2C-x64
# run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln
run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER il2c.sln

#----------------------------------------------------------------------

- name: Test il2c (BasicTypes)
run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True
timeout-minutes: 20
- name: Test il2c (ILConverters)
run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True
timeout-minutes: 20
- name: Test il2c (RuntimeSystems)
run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True
timeout-minutes: 20

#----------------------------------------------------------------------

- name: Build GettingStartedIL2C
run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples/GettingStartedIL2C/GettingStartedIL2C.sln

- name: Build Calculator.Core
run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform="AnyCPU" samples/Calculator/Calculator.Core/Calculator.Core.csproj
# - name: Build Calculator-x86
# run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples/Calculator/Calculator.sln
# - name: Build Calculator-x64
# run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples/Calculator/Calculator.sln
run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples/Calculator/Calculator.Core/Calculator.Core.csproj
- name: Build Calculator
run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples/Calculator/Calculator/Calculator.csproj

#- name: Build Calculator-x86
# run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples/Calculator/Calculator.sln
#- name: Build Calculator-x64
# run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples/Calculator/Calculator.sln

- name: Build Calculator-CMake-mingw32
run: bash build.sh ${{env.buildConfiguration}}
working-directory: samples/Calculator/Calculator.CMake
- name: Test il2c
run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True
timeout-minutes: 20

#----------------------------------------------------------------------

- name: Build packages
run: |
dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src/IL2C.Interop/IL2C.Interop.csproj
dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src/IL2C.Core/IL2C.Core.csproj
dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src/IL2C.Build/IL2C.Build.csproj
dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.csproj
#----------------------------------------------------------------------

#- name: Deploy NuGet package (Release/devel/il2c-devel)
# if: (env.buildConfiguration == 'Release') && (startsWith(github.ref, 'refs/tags/'))
# run: |
# dotnet nuget push artifacts/IL2C.Interop.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
# dotnet nuget push artifacts/IL2C.Core.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
# dotnet nuget push artifacts/IL2C.Build.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
# dotnet nuget push artifacts/IL2C.Toolchain.gcc4.mingw32.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}

#----------------------------------------------------------------------

#- name: Deploy NuGet package (Release/master/nuget.org)
# if: (env.buildConfiguration == 'Release') && (startsWith(github.ref, 'refs/tags/')) && (endsWith(steps.extract_branch_name.outputs.branch_name, 'master'))
# run: |
# dotnet nuget push artifacts/IL2C.Interop.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
# dotnet nuget push artifacts/IL2C.Core.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
# dotnet nuget push artifacts/IL2C.Build.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
# dotnet nuget push artifacts/IL2C.Toolchain.gcc4.mingw32.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
128 changes: 93 additions & 35 deletions .github/workflows/build-windows.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
name: Windows
on:
push:
branches:
- master
- devel
- feature/github-actions-2
pull_request:
branches:
- master
- devel
workflow_dispatch:
branches:
on: [push]
permissions:
contents: read
jobs:
Expand All @@ -23,57 +12,126 @@ jobs:
env:
buildConfiguration: ${{ matrix.buildConfiguration }}
steps:

#----------------------------------------------------------------------

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
# https://stackoverflow.com/questions/61463578/github-actions-actions-checkoutv2-lfs-true-flag-not-converting-pointers-to-act

- name: Checkout LFS objects
run: git lfs checkout
- name: Setup .NET Core 2.1

- name: Extract branch name
id: extract_branch_name
run: |
$branch_name=$(git name-rev --name-only --exclude=tags/* HEAD)
echo "Detected current branch: ${branch_name}"
echo "::set-output name=branch_name::${branch_name}"
#----------------------------------------------------------------------

- name: Setup .NET Core 2.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.818
dotnet-version: 2.2.*
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.414
dotnet-version: 3.1.*
- name: Setup .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.402
dotnet-version: 5.0.*
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100
dotnet-version: 6.0.*

#----------------------------------------------------------------------

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

- name: Setup NuGet CLI
uses: nuget/setup-nuget@v1

#----------------------------------------------------------------------

- name: Initialize tools
run: init-tools.bat
shell: cmd
- name: Install dependencies
run: |
dotnet restore il2c.sln
dotnet restore samples\GettingStartedIL2C\GettingStartedIL2C.sln
dotnet restore samples\Calculator\Calculator.sln

#----------------------------------------------------------------------

- name: Build runtime library
run: build-runtime.bat ${{env.buildConfiguration}}
shell: cmd

#----------------------------------------------------------------------

- name: Build il2c
run: msbuild -p:Configuration=${{env.buildConfiguration}} -r:false -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform="Any CPU" -maxCpuCount il2c.sln
- name: Build GettingStartedIL2C-x86
run: msbuild -p:Configuration=${{env.buildConfiguration}} -r:false -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 -maxCpuCount samples\GettingStartedIL2C\GettingStartedIL2C.sln
- name: Build GettingStartedIL2C-x64
run: msbuild -p:Configuration=${{env.buildConfiguration}} -r:false -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 -maxCpuCount samples\GettingStartedIL2C\GettingStartedIL2C.sln
- name: Build Calculator-x86
run: msbuild -p:Configuration=${{env.buildConfiguration}} -r:false -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 -maxCpuCount samples\Calculator\Calculator.sln
- name: Build Calculator-x64
run: msbuild -p:Configuration=${{env.buildConfiguration}} -r:false -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 -maxCpuCount samples\Calculator\Calculator.sln
run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER il2c.sln

#----------------------------------------------------------------------

- name: Test il2c (BasicTypes)
run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests\IL2C.Core.Test.BasicTypes\IL2C.Core.Test.BasicTypes.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True
timeout-minutes: 20
- name: Test il2c (ILConverters)
run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests\IL2C.Core.Test.ILConverters\IL2C.Core.Test.ILConverters.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True
timeout-minutes: 20
- name: Test il2c (RuntimeSystems)
run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests\IL2C.Core.Test.RuntimeSystems\IL2C.Core.Test.RuntimeSystems.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True
timeout-minutes: 20

#----------------------------------------------------------------------

- name: Build GettingStartedIL2C
run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples\GettingStartedIL2C\GettingStartedIL2C.sln

- name: Build Calculator.Core
run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples\Calculator\Calculator.Core\Calculator.Core.csproj
- name: Build Calculator
run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples\Calculator\Calculator\Calculator.csproj

#- name: Build Calculator-x86
# run: msbuild -p:Configuration=${{env.buildConfiguration}} -r:false -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 -maxCpuCount samples\Calculator\Calculator.sln
#- name: Build Calculator-x64
# run: msbuild -p:Configuration=${{env.buildConfiguration}} -r:false -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 -maxCpuCount samples\Calculator\Calculator.sln

- name: Build Calculator-CMake-mingw32
run: build.bat ${{env.buildConfiguration}}
shell: cmd
working-directory: samples\Calculator\Calculator.CMake
- name: Test il2c
run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests\IL2C.Core.Test.Fixture\IL2C.Core.Test.Fixture.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True
timeout-minutes: 20

#----------------------------------------------------------------------

- name: Build packages
run: |
dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src\IL2C.Interop\IL2C.Interop.csproj
dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src\IL2C.Core\IL2C.Core.csproj
dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src\IL2C.Build\IL2C.Build.csproj
dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts misc\IL2C.Toolchain.gcc4.mingw32\IL2C.Toolchain.gcc4.mingw32.csproj
#----------------------------------------------------------------------

- name: Deploy NuGet package (Release/devel/il2c-devel)
if: (env.buildConfiguration == 'Release') && (startsWith(github.ref, 'refs/tags/'))
run: |
dotnet nuget push artifacts\IL2C.Interop.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
dotnet nuget push artifacts\IL2C.Core.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
dotnet nuget push artifacts\IL2C.Build.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
dotnet nuget push artifacts\IL2C.Toolchain.gcc4.mingw32.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
#----------------------------------------------------------------------

#- name: Deploy NuGet package (Release/master/nuget.org)
# if: (env.buildConfiguration == 'Release') && (startsWith(github.ref, 'refs/tags/')) && (endsWith(steps.extract_branch_name.outputs.branch_name, 'master'))
# run: |
# dotnet nuget push artifacts\IL2C.Interop.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
# dotnet nuget push artifacts\IL2C.Core.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
# dotnet nuget push artifacts\IL2C.Build.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
# dotnet nuget push artifacts\IL2C.Toolchain.gcc4.mingw32.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
4 changes: 2 additions & 2 deletions .nuget/nuget.exe
Git LFS file not shown
1 change: 0 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
<clear />
<add key="il2c-devel" value="https://www.myget.org/F/il2c/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="kekyo" value="https://www.myget.org/F/kekyo/api/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion docs/sample-translation-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void HelloWorld_Main()
.maxstack 2
ldstr "ABC"
isinst [mscorlib]System.ValueType
brnull.s F1
brfalse.s F1
ldc.i4.1
ret
F1:
Expand Down
Loading

0 comments on commit 2802237

Please sign in to comment.