Skip to content

Commit 260f94d

Browse files
feat: get ready for sqlite-sync to be released & update dependencies (#275)
1 parent ec14177 commit 260f94d

File tree

26 files changed

+3106
-2207
lines changed

26 files changed

+3106
-2207
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
refs:
44
- &container
55
docker:
6-
- image: node:12.16.3
6+
- image: node:14
77
environment:
88
PG_URL: 'postgres://test-user@localhost:5432/test-db'
99
MYSQL_URL: 'mysql://test-user:password@localhost:3306/test-db'

.github/workflows-src/test.ts

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import {readdirSync, statSync} from 'fs';
22
import createWorkflow, {Job, Steps} from 'github-actions-workflow-builder';
3-
import {github, runner, secrets} from 'github-actions-workflow-builder/context';
3+
import {runner} from 'github-actions-workflow-builder/context';
44
import {
5-
eq,
65
Expression,
76
hashFiles,
87
interpolate,
9-
neq,
108
} from 'github-actions-workflow-builder/expression';
119

1210
export function yarnInstallWithCache(nodeVersion: Expression<string>): Steps {
@@ -116,51 +114,14 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {
116114

117115
const build = addJob('build', buildJob());
118116

119-
addJob('publish_website', ({addDependencies, add, run, use, when}) => {
120-
const {
121-
outputs: {output: buildOutput},
122-
} = addDependencies(build);
123-
124-
add(setup());
125-
126-
add(loadOutput(buildOutput, 'packages/'));
127-
128-
use('Enable NextJS Cache', 'actions/cache@v2', {
129-
with: {
130-
path: ['packages/website/.next/cache'].join('\n'),
131-
key: interpolate`next-${hashFiles('yarn.lock')}`,
132-
'restore-keys': [`next-`].join('\n'),
133-
},
134-
});
135-
136-
run('yarn workspace @databases/website build');
137-
138-
when(eq(github.event_name, `push`), () => {
139-
run(`netlify deploy --prod --dir=packages/website/out`, {
140-
env: {
141-
NETLIFY_SITE_ID: secrets.NETLIFY_SITE_ID,
142-
NETLIFY_AUTH_TOKEN: secrets.NETLIFY_AUTH_TOKEN,
143-
},
144-
});
145-
});
146-
when(neq(github.event_name, `push`), () => {
147-
run(`netlify deploy --dir=packages/website/out`, {
148-
env: {
149-
NETLIFY_SITE_ID: secrets.NETLIFY_SITE_ID,
150-
NETLIFY_AUTH_TOKEN: secrets.NETLIFY_AUTH_TOKEN,
151-
},
152-
});
153-
});
154-
});
155-
156117
addJob('test_node', ({setBuildMatrix, addDependencies, add, run}) => {
157118
const {
158119
outputs: {output: buildOutput},
159120
} = addDependencies(build);
160121

161122
const {node} = setBuildMatrix(
162123
{
163-
node: ['12.x', '14.x'],
124+
node: ['14.x', '16.x', '18.x'],
164125
},
165126
{failFast: false},
166127
);
@@ -179,7 +140,7 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {
179140

180141
const {node, pg} = setBuildMatrix(
181142
{
182-
node: ['12.x', '14.x'],
143+
node: ['14.x', '18.x'],
183144
pg: [
184145
// '9.6.19-alpine', -- unsupported by pg-migrations
185146
'10.14-alpine',
@@ -207,7 +168,7 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {
207168

208169
const {node, mysql} = setBuildMatrix(
209170
{
210-
node: ['12.x', '14.x'],
171+
node: ['14.x', '18.x'],
211172
mysql: ['5.6.51', '5.7.33', '8.0.23'],
212173
},
213174
{failFast: false},

.github/workflows-src/website.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import createWorkflow from 'github-actions-workflow-builder';
2+
import {github, secrets} from 'github-actions-workflow-builder/context';
3+
import {
4+
eq,
5+
hashFiles,
6+
interpolate,
7+
neq,
8+
} from 'github-actions-workflow-builder/expression';
9+
import {buildCache, setup} from './test';
10+
11+
export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {
12+
setWorkflowName('Website');
13+
14+
addTrigger('push', {branches: ['master']});
15+
addTrigger('pull_request', {branches: ['master']});
16+
17+
addJob('publish_website', ({add, run, use, when}) => {
18+
add(setup());
19+
20+
add(buildCache());
21+
22+
run('yarn build');
23+
24+
use('Enable NextJS Cache', 'actions/cache@v2', {
25+
with: {
26+
path: ['packages/website/.next/cache'].join('\n'),
27+
key: interpolate`next-${hashFiles('yarn.lock')}`,
28+
'restore-keys': [`next-`].join('\n'),
29+
},
30+
});
31+
32+
run('yarn workspace @databases/website build');
33+
34+
when(eq(github.event_name, `push`), () => {
35+
run(`netlify deploy --prod --dir=packages/website/out`, {
36+
env: {
37+
NETLIFY_SITE_ID: secrets.NETLIFY_SITE_ID,
38+
NETLIFY_AUTH_TOKEN: secrets.NETLIFY_AUTH_TOKEN,
39+
},
40+
});
41+
});
42+
when(neq(github.event_name, `push`), () => {
43+
run(`netlify deploy --dir=packages/website/out`, {
44+
env: {
45+
NETLIFY_SITE_ID: secrets.NETLIFY_SITE_ID,
46+
NETLIFY_AUTH_TOKEN: secrets.NETLIFY_AUTH_TOKEN,
47+
},
48+
});
49+
});
50+
});
51+
});

.github/workflows/test.yml

Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
packages/mysql-test/lib
5353
packages/mysql-typed/lib
5454
packages/pg/lib
55+
packages/pg-bulk/lib
56+
packages/pg-cluster/lib
5557
packages/pg-config/lib
5658
packages/pg-connection-string/lib
5759
packages/pg-create/lib
@@ -70,6 +72,7 @@ jobs:
7072
packages/split-sql-query/lib
7173
packages/sql/lib
7274
packages/sqlite/lib
75+
packages/sqlite-sync/lib
7376
packages/validate-unicode/lib
7477
packages/websql/lib
7578
packages/websql-core/lib
@@ -90,6 +93,8 @@ jobs:
9093
packages/mysql-test/.last_build
9194
packages/mysql-typed/.last_build
9295
packages/pg/.last_build
96+
packages/pg-bulk/.last_build
97+
packages/pg-cluster/.last_build
9398
packages/pg-config/.last_build
9499
packages/pg-connection-string/.last_build
95100
packages/pg-create/.last_build
@@ -108,6 +113,7 @@ jobs:
108113
packages/split-sql-query/.last_build
109114
packages/sql/.last_build
110115
packages/sqlite/.last_build
116+
packages/sqlite-sync/.last_build
111117
packages/validate-unicode/.last_build
112118
packages/websql/.last_build
113119
packages/websql-core/.last_build
@@ -121,6 +127,7 @@ jobs:
121127
'packages/mysql-schema-introspect/src',
122128
'packages/mysql-schema-print-types/src', 'packages/mysql-test/src',
123129
'packages/mysql-typed/src', 'packages/pg/src',
130+
'packages/pg-bulk/src', 'packages/pg-cluster/src',
124131
'packages/pg-config/src', 'packages/pg-connection-string/src',
125132
'packages/pg-create/src', 'packages/pg-data-type-id/src',
126133
'packages/pg-errors/src', 'packages/pg-migrations/src',
@@ -130,8 +137,9 @@ jobs:
130137
'packages/queue/src', 'packages/shared/src',
131138
'packages/shared-print-types/src', 'packages/split-sql-query/src',
132139
'packages/sql/src', 'packages/sqlite/src',
133-
'packages/validate-unicode/src', 'packages/websql/src',
134-
'packages/websql-core/src', 'packages/with-container/src')}}
140+
'packages/sqlite-sync/src', 'packages/validate-unicode/src',
141+
'packages/websql/src', 'packages/websql-core/src',
142+
'packages/with-container/src')}}
135143
restore-keys: v2-build-output-
136144
- run: yarn build
137145
- name: "Save output: build"
@@ -143,59 +151,16 @@ jobs:
143151
packages/*/.last_build
144152
outputs:
145153
output: build
146-
publish_website:
147-
needs:
148-
- build
149-
runs-on: ubuntu-latest
150-
steps:
151-
- uses: actions/checkout@v2
152-
- uses: actions/setup-node@v1
153-
with:
154-
node-version: 14.x
155-
registry-url: https://registry.npmjs.org
156-
- name: Get yarn cache directory path
157-
run: echo "::set-output name=dir::$(yarn cache dir)"
158-
id: step_3
159-
- name: Enable Cache
160-
uses: actions/cache@v2
161-
with:
162-
path: |-
163-
${{steps.step_3.outputs.dir}}
164-
node_modules
165-
packages/*/node_modules
166-
key: ${{runner.os}}-14.x-${{hashFiles('yarn.lock')}}-2
167-
- run: yarn install --prefer-offline
168-
- name: "Load output: ${{needs.build.outputs.output}}"
169-
uses: actions/download-artifact@v2
170-
with:
171-
name: ${{ needs.build.outputs.output }}
172-
path: packages/
173-
- name: Enable NextJS Cache
174-
uses: actions/cache@v2
175-
with:
176-
path: packages/website/.next/cache
177-
key: next-${{hashFiles('yarn.lock')}}
178-
restore-keys: next-
179-
- run: yarn workspace @databases/website build
180-
- if: ${{ github.event_name == 'push' }}
181-
run: netlify deploy --prod --dir=packages/website/out
182-
env:
183-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
184-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
185-
- if: ${{ github.event_name != 'push' }}
186-
run: netlify deploy --dir=packages/website/out
187-
env:
188-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
189-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
190154
test_node:
191155
needs:
192156
- build
193157
runs-on: ubuntu-latest
194158
strategy:
195159
matrix:
196160
node:
197-
- 12.x
198161
- 14.x
162+
- 16.x
163+
- 18.x
199164
fail-fast: false
200165
steps:
201166
- uses: actions/checkout@v2
@@ -228,8 +193,8 @@ jobs:
228193
strategy:
229194
matrix:
230195
node:
231-
- 12.x
232196
- 14.x
197+
- 18.x
233198
pg:
234199
- 10.14-alpine
235200
- 11.9-alpine
@@ -270,8 +235,8 @@ jobs:
270235
strategy:
271236
matrix:
272237
node:
273-
- 12.x
274238
- 14.x
239+
- 18.x
275240
mysql:
276241
- 5.6.51
277242
- 5.7.33

0 commit comments

Comments
 (0)