@@ -39,16 +39,17 @@ jobs:
39
39
MySqlConnectorExample
40
40
NpgsqlExample
41
41
42
-
42
+
43
43
ci :
44
44
name : CI
45
45
runs-on : ${{ matrix.os }}
46
46
if : ${{ always() }}
47
47
strategy :
48
48
matrix :
49
- os : [ ubuntu-latest ]
50
- architecture : [ " x64", " arm64" ]
49
+ os : [ ' ubuntu-latest' ]
50
+ architecture : [ ' x64', ' arm64' ]
51
51
dotnet-version : [ '8.0.x' ]
52
+ file-per-query : [ 'true', 'false' ]
52
53
53
54
steps :
54
55
- uses : actions/checkout@v4
@@ -84,32 +85,41 @@ jobs:
84
85
./scripts/wasm/copy_to_dist.sh
85
86
./scripts/wasm/update_sha.sh
86
87
88
+ - name : Verify pushed Dockerfile is synced
89
+ run : |
90
+ ./scripts/generate_dockerfile.sh /tmp/Dockerfile
91
+ diff /tmp/Dockerfile Dockerfile
92
+
87
93
- uses : sqlc-dev/setup-sqlc@v4
88
94
with :
89
95
sqlc-version : ' 1.25.0'
90
96
97
+ - name : Updating configuration
98
+ env :
99
+ FILE_PER_QUERY : ${{ matrix.file-per-query }}
100
+ run : ./scripts/update_config.sh $FILE_PER_QUERY
101
+
91
102
- name : Verify pushed generated code is synced
103
+ if : matrix.file-per-query == 'false'
92
104
run : sqlc -f sqlc.wasm.yaml diff
93
-
94
- - name : Verify pushed Dockerfile is synced
95
- run : |
96
- ./scripts/generate_dockerfile.sh /tmp/Dockerfile
97
- diff /tmp/Dockerfile Dockerfile
98
-
105
+
99
106
- name : Sqlc generate using Wasm plugin
100
- run : sqlc -f sqlc.wasm.yaml generate
101
-
102
- -
uses :
hoverkraft-tech/[email protected]
107
+ run : |
108
+ rm MySqlConnectorExample/*.cs NpgsqlExample/*.cs
109
+ sqlc -f sqlc.wasm.yaml generate
110
+
111
+ - name : Docker compose
112
+ if : matrix.file-per-query == 'false'
113
+ uses :
hoverkraft-tech/[email protected]
103
114
with :
104
- services : |
105
- mysqldb
106
- postgresdb
107
- plugin-tests
108
-
115
+ services : |
116
+ mysqldb
117
+ postgresdb
118
+ plugin-tests
119
+
109
120
- name : Test generated code
110
- run : |
111
- chmod +x ./scripts/run_tests.sh
112
- ./scripts/run_tests.sh
121
+ if : matrix.file-per-query == 'false'
122
+ run : ./scripts/run_tests.sh
113
123
114
124
- name : upload wasm plugin as artifact
115
125
uses : actions/upload-artifact@v2
@@ -119,7 +129,7 @@ jobs:
119
129
path : dist/plugin.wasm
120
130
121
131
release :
122
- name : Release test
132
+ name : Release
123
133
runs-on : ubuntu-latest
124
134
if : github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[release]')
125
135
needs : [ci]
0 commit comments