1
1
name : Linux
2
- on :
3
- push :
4
- branches :
5
- - master
6
- - devel
7
- - feature/github-actions-2
8
- pull_request :
9
- branches :
10
- - master
11
- - devel
12
- workflow_dispatch :
13
- branches :
2
+ on : [push]
14
3
permissions :
15
4
contents : read
16
5
jobs :
@@ -23,55 +12,123 @@ jobs:
23
12
env :
24
13
buildConfiguration : ${{ matrix.buildConfiguration }}
25
14
steps :
15
+
16
+ # ----------------------------------------------------------------------
17
+
26
18
- name : Checkout
27
19
uses : actions/checkout@v2
28
20
with :
29
21
fetch-depth : 0
30
22
lfs : true
31
- # https://stackoverflow.com/questions/61463578/github-actions-actions-checkoutv2-lfs-true-flag-not-converting-pointers-to-act
23
+
32
24
- name : Checkout LFS objects
33
25
run : git lfs checkout
34
- - name : Setup .NET Core 2.1
26
+
27
+ - name : Extract branch name
28
+ id : extract_branch_name
29
+ run : |
30
+ export branch_name=`git name-rev --name-only --exclude=tags/* HEAD`
31
+ echo "Detected current branch: $branch_name"
32
+ echo "::set-output name=branch_name::$branch_name"
33
+
34
+ # ----------------------------------------------------------------------
35
+
36
+ - name : Setup .NET Core 2.2
35
37
uses : actions/setup-dotnet@v1
36
38
with :
37
- dotnet-version : 2.1.818
39
+ dotnet-version : 2.2.*
38
40
- name : Setup .NET Core 3.1
39
41
uses : actions/setup-dotnet@v1
40
42
with :
41
- dotnet-version : 3.1.414
43
+ dotnet-version : 3.1.*
42
44
- name : Setup .NET 5
43
45
uses : actions/setup-dotnet@v1
44
46
with :
45
- dotnet-version : 5.0.402
47
+ dotnet-version : 5.0.*
46
48
- name : Setup .NET 6
47
49
uses : actions/setup-dotnet@v1
48
50
with :
49
- dotnet-version : 6.0.100
51
+ dotnet-version : 6.0.*
52
+
53
+ # ----------------------------------------------------------------------
54
+
55
+ # - name: Add msbuild to PATH
56
+ # uses: microsoft/setup-msbuild@v1.0.3
57
+
58
+ # - name: Setup NuGet CLI
59
+ # uses: nuget/setup-nuget@v1
60
+
61
+ # ----------------------------------------------------------------------
62
+
50
63
# - name: Initialize tools
51
64
# run: bash .github/workflows/init-tools-on-ga.sh
52
- - name : Install dependencies
53
- run : |
54
- dotnet restore il2c.sln
55
- dotnet restore samples/Calculator/Calculator.Core/Calculator.Core.csproj
56
- # dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln
57
- # dotnet restore samples/Calculator/Calculator.sln
65
+
66
+ # ----------------------------------------------------------------------
67
+
58
68
- name : Build runtime library
59
69
run : bash build-runtime.sh ${{env.buildConfiguration}}
70
+
71
+ # ----------------------------------------------------------------------
72
+
60
73
- name : Build il2c
61
- run : dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform="Any CPU" il2c.sln
62
- # - name: Build GettingStartedIL2C-x86
63
- # run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln
64
- # - name: Build GettingStartedIL2C-x64
65
- # run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln
74
+ run : dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER il2c.sln
75
+
76
+ # ----------------------------------------------------------------------
77
+
78
+ - name : Test il2c (BasicTypes)
79
+ 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
80
+ timeout-minutes : 20
81
+ - name : Test il2c (ILConverters)
82
+ 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
83
+ timeout-minutes : 20
84
+ - name : Test il2c (RuntimeSystems)
85
+ 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
86
+ timeout-minutes : 20
87
+
88
+ # ----------------------------------------------------------------------
89
+
90
+ - name : Build GettingStartedIL2C
91
+ run : dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples/GettingStartedIL2C/GettingStartedIL2C.sln
92
+
66
93
- name : Build Calculator.Core
67
- run : dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform="AnyCPU" samples/Calculator/Calculator.Core/Calculator.Core.csproj
68
- # - name: Build Calculator-x86
69
- # run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples/Calculator/Calculator.sln
70
- # - name: Build Calculator-x64
71
- # run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples/Calculator/Calculator.sln
94
+ run : dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples/Calculator/Calculator.Core/Calculator.Core.csproj
95
+ - name : Build Calculator
96
+ run : dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER samples/Calculator/Calculator/Calculator.csproj
97
+
98
+ # - name: Build Calculator-x86
99
+ # run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples/Calculator/Calculator.sln
100
+ # - name: Build Calculator-x64
101
+ # run: dotnet build --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples/Calculator/Calculator.sln
102
+
72
103
- name : Build Calculator-CMake-mingw32
73
104
run : bash build.sh ${{env.buildConfiguration}}
74
105
working-directory : samples/Calculator/Calculator.CMake
75
- - name : Test il2c
76
- 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
77
- timeout-minutes : 20
106
+
107
+ # ----------------------------------------------------------------------
108
+
109
+ - name : Build packages
110
+ run : |
111
+ dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src/IL2C.Interop/IL2C.Interop.csproj
112
+ dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src/IL2C.Core/IL2C.Core.csproj
113
+ dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts src/IL2C.Build/IL2C.Build.csproj
114
+ dotnet pack --configuration ${{env.buildConfiguration}} -p:BuildIdentifier=$GITHUB_RUN_NUMBER -o artifacts misc/IL2C.Toolchain.gcc4.mingw32/IL2C.Toolchain.gcc4.mingw32.csproj
115
+
116
+ # ----------------------------------------------------------------------
117
+
118
+ # - name: Deploy NuGet package (Release/devel/il2c-devel)
119
+ # if: (env.buildConfiguration == 'Release') && (startsWith(github.ref, 'refs/tags/'))
120
+ # run: |
121
+ # dotnet nuget push artifacts/IL2C.Interop.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
122
+ # dotnet nuget push artifacts/IL2C.Core.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
123
+ # dotnet nuget push artifacts/IL2C.Build.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
124
+ # dotnet nuget push artifacts/IL2C.Toolchain.gcc4.mingw32.*.nupkg --source il2c-devel --api-key ${{secrets.GH_IL2C_NUGET_MYGET_KEY}}
125
+
126
+ # ----------------------------------------------------------------------
127
+
128
+ # - name: Deploy NuGet package (Release/master/nuget.org)
129
+ # if: (env.buildConfiguration == 'Release') && (startsWith(github.ref, 'refs/tags/')) && (endsWith(steps.extract_branch_name.outputs.branch_name, 'master'))
130
+ # run: |
131
+ # dotnet nuget push artifacts/IL2C.Interop.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
132
+ # dotnet nuget push artifacts/IL2C.Core.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
133
+ # dotnet nuget push artifacts/IL2C.Build.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
134
+ # dotnet nuget push artifacts/IL2C.Toolchain.gcc4.mingw32.*.nupkg --source nuget.org --api-key ${{secrets.GH_IL2C_NUGET_NUGET_KEY}}
0 commit comments