@@ -33,45 +33,11 @@ jobs:
33
33
workspace : sqlc-gen-csharp.sln
34
34
exclude : |
35
35
GeneratedProtobuf
36
- MySqlConnectorExample
37
- MySqlConnectorDapperExample
38
- NpgsqlExample
39
- NpgsqlDapperExample
40
- SqliteExample
41
- SqliteDapperExample
42
-
43
- - name : Verify pushed Dockerfile is synced
44
- run : |
45
- ./scripts/generate_dockerfile.sh /tmp/Dockerfile
46
- diff /tmp/Dockerfile Dockerfile
47
-
48
- build :
49
- name : Build
50
- runs-on : ${{ matrix.os }}
51
- needs : [lint]
52
- strategy :
53
- matrix :
54
- os : [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
55
- architecture : [ 'x64', 'arm64' ]
56
-
57
- steps :
58
- - uses : actions/checkout@v4
59
- - name : Load .env file
60
-
61
- with :
62
- load-mode : strict
63
-
64
- - name : Setup Dotnet
65
- uses : actions/setup-dotnet@v4
66
- with :
67
- dotnet-version : ' 8.0.x'
36
+ examples
68
37
69
- - name : Dotnet Build
70
- run : dotnet build
71
-
72
- publish :
73
- name : Publish WASM
74
- needs : [build]
38
+ build-wasm :
39
+ name : Build (WASM)
40
+ needs : [lint]
75
41
runs-on : ubuntu-latest
76
42
77
43
steps :
@@ -108,43 +74,71 @@ jobs:
108
74
name : wasm-file
109
75
path : dist/plugin.wasm
110
76
111
- codegen-tests :
112
- name : Codegen Tests
77
+ # codegen-tests:
78
+ # name: Codegen Tests
79
+ # runs-on: ubuntu-latest
80
+ # needs: [build-wasm]
81
+ #
82
+ # steps:
83
+ # - uses: actions/checkout@v4
84
+ #
85
+ # - uses: actions/download-artifact@v4
86
+ # with:
87
+ # name: wasm-file
88
+ # path: dist
89
+ #
90
+ # - name: Load .env file
91
+
92
+ # with:
93
+ # load-mode: strict
94
+ #
95
+ # - uses: sqlc-dev/setup-sqlc@v4
96
+ # with:
97
+ # sqlc-version: '1.25.0'
98
+ #
99
+ # - name: Updating plugin sha
100
+ # run: ./scripts/wasm/update_sha.sh ${SQLC_CI_FILE}
101
+ #
102
+ # - name: Verify pushed generated code is synced
103
+ # run: |
104
+ # ./scripts/wasm/update_sha.sh ${SQLC_CI_FILE}
105
+ # sqlc -f ${SQLC_CI_FILE} diff
106
+ #
107
+ # - name: Codegen Tests against matrix of configurations
108
+ # run: ./scripts/tests/run_codegen_matrix.sh ${SQLC_CI_FILE}
109
+
110
+ end2end-tests :
111
+ name : End-to-End Tests
113
112
runs-on : ubuntu-latest
114
- needs : [publish ]
113
+ needs : [build-wasm ]
115
114
116
115
steps :
117
116
- uses : actions/checkout@v4
118
-
119
117
- uses : actions/download-artifact@v4
120
118
with :
121
119
name : wasm-file
122
120
path : dist
123
-
124
- - name : Load .env file
125
-
126
- with :
127
- load-mode : strict
128
121
129
122
- uses : sqlc-dev/setup-sqlc@v4
130
123
with :
131
124
sqlc-version : ' 1.25.0'
132
125
133
- - name : Updating plugin sha
134
- run : ./scripts/wasm/update_sha.sh ${SQLC_CI_FILE}
126
+ - name : Load .env file
127
+
128
+ with :
129
+ load-mode : strict
130
+
131
+ - name : Docker compose
132
+ uses :
hoverkraft-tech/[email protected]
135
133
136
- - name : Verify pushed generated code is synced
137
- run : |
138
- ./scripts/wasm/update_sha.sh ${SQLC_CI_FILE}
139
- sqlc -f ${SQLC_CI_FILE} diff
140
-
141
- - name : Codegen Tests against matrix of configurations
142
- run : ./scripts/tests/run_codegen_matrix.sh ${SQLC_CI_FILE}
134
+ - name : End-to-End Tests
135
+ run : ./scripts/tests/run_end2end.sh
143
136
144
- end2end-tests :
145
- name : End-to-End Tests
146
- runs-on : ubuntu-latest
147
- needs : [codegen-tests]
137
+ legacy-end2end-tests :
138
+ # As this can run only on Windows machines, this implementation should only run in the CI
139
+ name : End-to-End Tests (Legacy)
140
+ runs-on : windows-latest
141
+ needs : [build-wasm]
148
142
149
143
steps :
150
144
- uses : actions/checkout@v4
@@ -161,14 +155,60 @@ jobs:
161
155
162
156
with :
163
157
load-mode : strict
164
-
165
- - name : Docker compose
166
- uses :
hoverkraft-tech/[email protected]
158
+
159
+ - name : Install Chocolatey
160
+ shell : powershell
161
+ run : |
162
+ Set-ExecutionPolicy Bypass -Scope Process -Force
163
+ [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
164
+ iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
165
+
166
+ - name : Install & Start MySQL
167
+ shell : powershell
168
+ run : choco install mysql --no-progress --version=8.0.31 -y --params "/serviceName:MySQL"
169
+
170
+ - name : Init MySQL Schema
171
+ shell : powershell
172
+ run : |
173
+ $env:Path += ";C:\Program Files\MySQL\MySQL Server 8.0\bin"
174
+ [Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine")
175
+ mysql -u root -e "CREATE DATABASE tests;"
176
+ mysql -u root tests --execute="source examples/authors/mysql/schema.sql"
177
+
178
+ - name : Install & Start PostgreSQL
179
+ shell : powershell
180
+ run : choco install postgresql17 --no-progress --version=17.2.0 -y --params "/Password:pass" --params-global
181
+
182
+ - name : Init PostgresSQL Schema
183
+ shell : powershell
184
+ run : |
185
+ $env:Path += ";C:\Program Files\PostgreSQL\17\bin"
186
+ $env:PGPASSWORD = "pass"
187
+ psql -U postgres -c "CREATE DATABASE tests;"
188
+ psql -U postgres -d tests -f "examples/authors/postgresql/schema.sql"
189
+
190
+ - name : Setup Visual Studio for .NET Framework
191
+ uses : microsoft/setup-msbuild@v1
167
192
with :
168
- services : |
169
- mysqldb
170
- postgresdb
171
- plugin-tests
193
+ vs-version : ' latest'
172
194
195
+ - name : Setup NuGet
196
+
197
+
198
+ - name : Restore test projects
199
+ shell : powershell
200
+ run : |
201
+ Get-ChildItem -Path examples -Recurse -Filter *.csproj |
202
+ Where-Object { $_.FullName -like '*Legacy*' } |
203
+ ForEach-Object { nuget restore $_.FullName }
204
+ nuget restore ./LegacyEndToEndTests/LegacyEndToEndTests.csproj
205
+
206
+ - name : Build .NET Framework Test Project
207
+ run : msbuild.exe ./LegacyEndToEndTests/LegacyEndToEndTests.csproj -p:Configuration=Release -p:FrameworkVersion=v4.7.2
208
+
173
209
- name : End-to-End Tests
174
- run : ./scripts/tests/run_end2end.sh
210
+ shell : powershell
211
+ run : |
212
+ $path = vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.Web -requiresAny -property installationPath
213
+ $path = join-path $path 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe'
214
+ & $path ./LegacyEndToEndTests/bin/Release/net472/LegacyEndToEndTests.dll
0 commit comments