-
Notifications
You must be signed in to change notification settings - Fork 214
163 lines (141 loc) · 4.68 KB
/
ci.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: CI
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
# See https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# env:
# Platform: x64 # For Msbuild
# Configuration: Release # For Msbuild
jobs:
ci:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
ice_build_flags: srcs
- os: macos-14
ice_build_flags: srcs
- os: windows-2022
ice_build_flags: /t:BuildDist
runs-on: ${{ matrix.os }}
steps:
- name: Windows Environment
if: runner.os == 'Windows'
run: |
# We need to replace \ with / in the path, specifically for Gradle
$iceHome = "${{ github.workspace }}/ice"
$iceHome = $iceHome.Replace("\", "/")
echo "ICE_HOME=$iceHome" >> $env:GITHUB_ENV
- name: Linux/MacOS Environment
if: runner.os != 'Windows'
run: |
echo "ICE_HOME=${{ github.workspace }}/ice" >> $GITHUB_ENV
- name: Checkout Ice
uses: actions/checkout@v4
with:
repository: zeroc-ice/ice
ref: main
path: ice
- name: Setup Ice Build Dependencies
uses: ./ice/.github/actions/setup-dependencies
- name: Build Ice
uses: ./ice/.github/actions/build
timeout-minutes: 60
with:
working_directory: ice
build_flags: ${{ runner.os == 'Windows' && '/t:BuildDist /p:Configuration=Release /p:Platform=x64' || 'srcs' }}
- name: Publish C# NuGet Packages
timeout-minutes: 5
working-directory: ice/csharp/msbuild
run: dotnet msbuild ice.proj /t:Publish /p:Configuration=Release /p:Platform=x64
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ice-demos
- name: Build C++ Demos
timeout-minutes: 20
working-directory: ice-demos/cpp
run: |
set -o pipefail
# No IceBT on macOS
if [[ "$(uname)" == "Darwin" ]]; then
rm -rf IceBT
fi
find . -name CMakeLists.txt -type f | while IFS= read -r file; do
dir=$(dirname "$file");
cmake -B "$dir/build" -S "$dir" -DIce_DEBUG=ON -DCMAKE_BUILD_TYPE=Release
cmake --build "$dir/build"
done
if: runner.os != 'Windows'
- name: Build C++ Demos
timeout-minutes: 20
working-directory: ice-demos/cpp
run: |
# No IceBT on Windows
Remove-Item -Recurse -Force "IceBT"
Get-ChildItem -Recurse -Filter CMakeLists.txt | ForEach-Object {
$dir = $_.DirectoryName
cmake -B "$dir/build" -S "$dir" -DIce_DEBUG=ON
cmake --build "$dir/build" --config Release
}
if: runner.os == 'Windows'
- name: Build C# Demos
timeout-minutes: 20
working-directory: ice-demos/csharp
run: |
find . -name '*.sln' -type f | while IFS= read -r file; do
dotnet build "$file"
done
if: runner.os != 'Windows'
- name: Build C# Demos
timeout-minutes: 20
working-directory: ice-demos/csharp
run: |
Get-ChildItem -Recurse -Filter *.sln | ForEach-Object {
dotnet build $_.FullName
}
if: runner.os == 'Windows'
- name: Run .NET format
working-directory: ice-demos/csharp
run: |
find . -name '*.sln' -type f | while IFS= read -r file; do
dotnet format --verify-no-changes "$file"
done
shell: bash
if: runner.os == 'Linux'
- name: Build Java Demos
timeout-minutes: 20
working-directory: ice-demos/java
env:
# For Ice Builder for Gradle
CPP_PLATFORM: x64
CPP_CONFIGURATION: Release
run: ./gradlew build
- name: Build JavaScript Demos
timeout-minutes: 20
working-directory: ice-demos/js
env:
# For Ice Builder for Gulp
CPP_PLATFORM: x64
CPP_CONFIGURATION: Release
run: |
npm install
npx gulp build
- name: Build Swift Demos
timeout-minutes: 20
working-directory: ice-demos/swift
run: |
set -o pipefail
find . -name Package.swift -type f | while IFS= read -r file; do
swift build --package-path "$(dirname "$file")"
done
if: runner.os == 'macOS'