-
Notifications
You must be signed in to change notification settings - Fork 9
140 lines (113 loc) · 4.71 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Build encoding converters and run tests
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: "./EncConverters 2019.sln"
jobs:
build-windows:
runs-on: windows-2019 # [windows-latest] # VS 2022 doesn't automatically include the proper .net framework
strategy:
# Keep building other jobs even if another fails, to show what _is_ still working.
fail-fast: false
matrix:
build_configuration: ["Debug", "Release"]
build_platform: ["Win32", "x64"]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Fetch nuget dependecies
run: nuget restore "${{env.SOLUTION_FILE_PATH}}"
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{matrix.build_configuration}} /p:Platform=${{ matrix.build_platform }} "${{env.SOLUTION_FILE_PATH}}"
- name: List Files in Repository
run: dir /s
shell: cmd
- uses: actions/[email protected]
with:
name: build-artifacts-${{ matrix.build_platform }}-${{ matrix.build_configuration }}
path: |
output\${{ matrix.build_platform }}\${{ matrix.build_configuration }}\*.exe
output\${{ matrix.build_platform }}\${{ matrix.build_configuration }}\*.dll
output\${{ matrix.build_platform }}\${{ matrix.build_configuration }}\*.tlb
output\${{ matrix.build_platform }}\${{ matrix.build_configuration }}\*.config
output\MergeModules\**\*.*
retention-days: 1
publish_nuget:
needs: build-windows
runs-on: windows-2019
strategy:
# Keep building other jobs even if another fails, to show what _is_ still working.
fail-fast: false
matrix:
build_configuration: ["Release"]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Get Folder Names
id: get-folders
run: |
$folderNames = Get-ChildItem -Directory -Path . | Where-Object { $_.Name -like 'build-artifacts-*' } | Select-Object -ExpandProperty Name
$folderNames
foreach ($folderName in $folderNames) {
$source = "$folderName\*.*"
"xcopy /s /y $source .\"
xcopy /s /y $source .\
}
- name: List Files in Repository
run: dir /s
shell: cmd
- name: Create NuGet Package
run: nuget pack ./Package.${{matrix.build_configuration}}.nuspec -OutputDirectory ./output/${{matrix.build_configuration}}
- name: Upload NuGet Package as Artifact
uses: actions/[email protected]
with:
name: ${{matrix.build_configuration}}-nuget-package
path: ./output/${{matrix.build_configuration}}/*.nupkg
# TODO Run tests
#- name: Test
# run: output/Win32/${{matrix.build_configuration}}/RunTests.exe
build-linux:
runs-on: [ubuntu-20.04]
strategy:
matrix:
build_configuration: ["Debug", "Release"]
steps:
- name: Add repo packages.sil.org
run: |
(wget -O- https://packages.sil.org/keys/pso-keyring-2016.gpg | sudo tee /etc/apt/trusted.gpg.d/pso-keyring-2016.gpg)&>/dev/null
(. /etc/os-release && sudo tee /etc/apt/sources.list.d/packages-sil-org.list>/dev/null <<< "deb http://packages.sil.org/$ID $VERSION_CODENAME main")
sudo apt-get update
- name: Install dependencies
run: sudo apt-get install --assume-yes automake g++ python2-dev python2 libicu-dev mono5-sil icu-dev-fw libteckit-dev
- name: Checkout
uses: actions/[email protected]
- name: List Files in Repository
run: ls -R
- name: Restore NuGet Packages
run: nuget restore "${{env.SOLUTION_FILE_PATH}}"
- name: Autogen
run: . environ && ./autogen.sh
- name: Build
run: . environ && make
- name: Test
if: matrix.build_configuration == 'Debug'
run: |
. environ
export EC_COMMON_APPLICATION_DATA_PATH="$(pwd)/ec-common"
export MONO_REGISTRY_PATH="${EC_COMMON_APPLICATION_DATA_PATH}/registry"
cp -a src/RunTests/bin/x64/${{matrix.build_configuration}}/RunTests.exe output/x64/${{matrix.build_configuration}}/
# Note that currently, many tests fail and it doesn't fail this build step.
mono output/x64/${{matrix.build_configuration}}/RunTests.exe