-
Notifications
You must be signed in to change notification settings - Fork 8
148 lines (131 loc) · 3.85 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
141
142
143
144
145
146
147
148
on:
pull_request:
paths:
- .github/workflows/build.yml
- '**.cs'
- '**.csproj'
push:
paths:
- .github/workflows/build.yml
- '**.cs'
- '**.csproj'
workflow_dispatch:
env:
DOTNET_VERSION: 9.0.x
jobs:
build-lip:
strategy:
fail-fast: false
matrix:
include:
- runtime: linux-arm64
runs-on: ubuntu-22.04
- runtime: linux-x64
runs-on: ubuntu-latest
- runtime: osx-arm64
runs-on: macos-latest
- runtime: osx-x64
runs-on: macos-latest
- runtime: win-arm64
runs-on: windows-latest
- runtime: win-x64
runs-on: windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- run: >
dotnet build Lip
--configuration Release
build-app:
strategy:
fail-fast: false
matrix:
project:
- Lip.CLI
include:
- runtime: linux-arm64
runs-on: ubuntu-22.04
- runtime: linux-x64
runs-on: ubuntu-latest
- runtime: osx-arm64
runs-on: macos-latest
- runtime: osx-x64
runs-on: macos-latest
- runtime: win-arm64
runs-on: windows-latest
- runtime: win-x64
runs-on: windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- if: matrix.runtime == 'linux-arm64'
run: |
sudo dpkg --add-architecture arm64
sudo bash -c 'cat > /etc/apt/sources.list.d/arm64.list <<EOF
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
EOF'
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
sudo sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list
sudo apt update
sudo apt install -y clang llvm binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu zlib1g-dev:arm64
- run: >
dotnet publish ${{ matrix.project }}
--configuration Release
--output bin
--runtime ${{ matrix.runtime }}
-p:OptimizationPreference=Size
-p:PublishAot=true
- uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ matrix.project }}-${{ matrix.runtime }}-${{ github.sha }}
path: bin/
test:
strategy:
fail-fast: false
matrix:
project:
- Lip.Tests
runs-on:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- run: |
dotnet restore ${{ matrix.project }}
- run: >
dotnet build ${{ matrix.project }}
-c Release
--no-restore
- run: >
dotnet test ${{ matrix.project }}
--no-build
check-style:
strategy:
fail-fast: false
matrix:
project:
- Lip
- Lip.Tests
- Lip.CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- run: >
dotnet format ${{ matrix.project }}
--verify-no-changes