-
-
Notifications
You must be signed in to change notification settings - Fork 13
116 lines (98 loc) · 3.99 KB
/
ci-cd.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
name: LibLCM CI and CD
on:
pull_request:
branches: [ develop, master ]
push:
branches: [ develop, master ]
# Trigger on release tags
tags: [ 'v[0-9]+*' ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
DOTNET_NOLOGO: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install mono-devel package
run: sudo apt-get install mono-devel
if: matrix.os == 'ubuntu-latest'
- name: Install icu-fw package
run: wget -qO - http://linux.lsdev.sil.org/downloads/sil-testing.gpg | sudo tee /etc/apt/trusted.gpg.d/linux-lsdev-sil-org.asc &&
sudo add-apt-repository "deb http://linux.lsdev.sil.org/ubuntu $(lsb_release -sc)-experimental main" &&
sudo apt-get install icu-fw
if: matrix.os == 'ubuntu-latest'
# Solve problems with CustomIcuFallbackTests: the current windows-latest image (2022) includes this file that breaks our tests.
- name: Solve problems
run: Remove-Item c:\tools\php\icuuc*.dll -Force
if: matrix.os == 'windows-latest'
- name: Download 461 targeting pack
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
id: downloadfile # Remember to give an ID if you need the output filename
with:
url: "https://download.microsoft.com/download/F/1/D/F1DEB8DB-D277-4EF9-9F48-3A65D4D8F965/NDP461-DevPack-KB3105179-ENU.exe"
target: public/
if: matrix.os == 'windows-latest'
- name: Install targeting pack
shell: cmd
working-directory: public
run: NDP461-DevPack-KB3105179-ENU.exe /q
if: matrix.os == 'windows-latest'
- name: Build
run: dotnet build --configuration Release
- name: Test on Linux
run: |
. environ
dotnet test --no-restore --no-build -p:ParallelizeAssembly=false --configuration Release --logger:"trx;LogFilePrefix=results" --results-directory ./test-results
if: matrix.os == 'ubuntu-latest'
- name: Test on Windows
run: dotnet test --no-restore --no-build -p:ParallelizeAssembly=false --configuration Release --logger:"trx;LogFilePrefix=results" --results-directory ./test-results
if: matrix.os != 'ubuntu-latest'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test results (${{ matrix.os }})
path: ./test-results
- name: Package
run: dotnet pack --include-symbols --no-restore --no-build -p:SymbolPackageFormat=snupkg --configuration Release
- name: Publish to Nuget
run: dotnet nuget push artifacts/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.SILLSDEV_PUBLISH_NUGET_ORG}} --skip-duplicate
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest'
- name: Publish to Github packages
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
run: dotnet nuget push artifacts/*.nupkg -s https://nuget.pkg.github.com/sillsdev/index.json -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: NugetPackages (${{ matrix.os }})
path: artifacts/*.nupkg
if: github.event_name == 'pull_request'
publish-test-results:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Download test results
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: Test results *
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
with:
check_name: LCM Tests
files: artifacts/**/*.trx
action_fail: true
action_fail_on_inconclusive: true