Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,33 @@ refs:
- &restore_cache
restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ checksum "package-lock.json" }}
- v1-dependencies-
- &save_cache
save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
key: v1-dependencies-{{ checksum "package-lock.json" }}
- &npm_auth
run:
name: NPM Auth
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- &yarn_install
- &npm_install
run:
name: Install Dependencies
command: yarn install --frozen-lockfile
command: npm install
- &build
run:
name: Build
command: yarn build
command: node --run build
- &test
run:
name: Test
command: yarn test --maxWorkers 2
command: node --run test -- --maxWorkers 2
- &prettier
run:
name: Prettier (check yarn prettier:write has been run)
command: yarn prettier:check
name: Prettier (check prettier:write has been run)
command: node --run prettier:check

jobs:
all:
Expand All @@ -56,7 +56,7 @@ jobs:
- checkout
- *restore_cache
- *npm_auth
- *yarn_install
- *npm_install
- *save_cache
- *prettier
- *build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows-src/rollingversions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default createWorkflow(
whenTrigger('push', () => {
addJob('publish_canary', ({add, run}) => {
add(setup());
run('yarn build');
run('node --run build');
run(
'npx rollingversions publish --canary $GITHUB_RUN_NUMBER --allow-any-branch',
{
Expand All @@ -33,7 +33,7 @@ export default createWorkflow(
whenTrigger('repository_dispatch', () => {
addJob('publish', ({add, run}) => {
add(setup());
run('yarn build');
run('node --run build');
run('npx rollingversions publish', {
env: {
GITHUB_TOKEN: secrets.GITHUB_TOKEN,
Expand Down
50 changes: 11 additions & 39 deletions .github/workflows-src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,10 @@ const DEFAULT_NODE_VERSION = '24.x';
const ALL_NODE_VERSIONS = ['20.x', '22.x', '24.x'];
const INTEGRATION_TEST_NODE_VERSIONS = ['22.x', '24.x'];

export function yarnInstallWithCache(nodeVersion: Expression<string>): Steps {
return ({use, run}) => {
const {
outputs: {dir: yarnCacheDir},
} = run<{dir: string}>(
`Get yarn cache directory path`,
`echo "::set-output name=dir::$(yarn cache dir)"`,
);
use('Enable Cache', 'actions/cache@v4', {
with: {
path: [
interpolate`${yarnCacheDir}`,
'node_modules',
'packages/*/node_modules',
].join('\n'),
key: interpolate`${runner.os}-${nodeVersion}-${hashFiles(
'yarn.lock',
)}-2`,
},
});
run('yarn install --prefer-offline');
};
}
export function setup(
nodeVersion: Expression<string> = DEFAULT_NODE_VERSION,
): Steps {
return ({use, add}) => {
return ({use, run}) => {
use('actions/checkout@v2');
use('actions/setup-node@v1', {
with: {
Expand All @@ -46,7 +23,7 @@ export function setup(
},
});

add(yarnInstallWithCache(nodeVersion));
run('npm install');
};
}

Expand All @@ -66,13 +43,10 @@ export function buildCache(): Steps {
use(`Enable Cache`, 'actions/cache@v4', {
with: {
path: [
...packageNames.map((packageName) => `packages/${packageName}/lib`),
...packageNames.map(
(packageName) => `packages/${packageName}/.last_build`,
),
...packageNames.map((packageName) => `packages/${packageName}/dist`),
].join('\n'),
key: interpolate`v2-build-output-${hashFiles(
`yarn.lock`,
`package-lock.json`,
...packageNames.map((packageName) => `packages/${packageName}/src`),
)}`,
'restore-keys': [`v2-build-output-`].join('\n'),
Expand Down Expand Up @@ -103,11 +77,9 @@ export function buildJob(): Job<{output: string}> {

add(buildCache());

run('yarn build');
run('node --run build');

const output = add(
saveOutput('build', ['packages/*/lib', 'packages/*/.last_build']),
);
const output = add(saveOutput('build', ['packages/*/dist']));
return {output};
};
}
Expand Down Expand Up @@ -136,7 +108,7 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {

add(loadOutput(buildOutput, 'packages/'));

run('yarn test:node');
run('node --run test:node');
});

addJob('test_pg', ({setBuildMatrix, addDependencies, add, run}) => {
Expand All @@ -162,7 +134,7 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {

add(loadOutput(buildOutput, 'packages/'));

run('yarn test:pg', {
run('node --run test:pg', {
env: {PG_TEST_IMAGE: interpolate`postgres:${pg}`, PG_TEST_DEBUG: 'TRUE'},
});
});
Expand All @@ -184,15 +156,15 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {

add(loadOutput(buildOutput, 'packages/'));

run('yarn test:mysql', {
run('node --run test:mysql', {
env: {MYSQL_TEST_IMAGE: interpolate`mysql:${mysql}`},
});
});

addJob('prettier', ({addDependencies, add, run}) => {
add(setup());

run('yarn prettier:check');
run('node --run prettier:check');
});

addJob('lint', ({addDependencies, add, run}) => {
Expand All @@ -204,6 +176,6 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {

add(loadOutput(buildOutput, 'packages/'));

run('yarn tslint');
run('node --run tslint');
});
});
6 changes: 3 additions & 3 deletions .github/workflows-src/website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {

add(buildCache());

run('yarn build');
run('node --run build');

use('Enable NextJS Cache', 'actions/cache@v4', {
with: {
path: ['packages/website/.next/cache'].join('\n'),
key: interpolate`next-${hashFiles('yarn.lock')}`,
key: interpolate`next-${hashFiles('package-lock.json')}`,
'restore-keys': [`next-`].join('\n'),
},
});

run('yarn workspace @databases/website build');
run('cd packages/website && node --run build');

run(`npm install netlify-cli@17.10.1 -g`);
const netlifyDeploy = [
Expand Down
30 changes: 4 additions & 26 deletions .github/workflows/rollingversions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,8 @@ jobs:
with:
node-version: 24.x
registry-url: https://registry.npmjs.org
- name: Get yarn cache directory path
run: echo "::set-output name=dir::$(yarn cache dir)"
id: step_3
- name: Enable Cache
uses: actions/cache@v4
with:
path: |-
${{ steps.step_3.outputs.dir }}
node_modules
packages/*/node_modules
key: ${{ runner.os }}-24.x-${{ hashFiles('yarn.lock') }}-2
- run: yarn install --prefer-offline
- run: yarn build
- run: npm install
- run: node --run build
- run: npx rollingversions publish --canary $GITHUB_RUN_NUMBER --allow-any-branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -46,19 +35,8 @@ jobs:
with:
node-version: 24.x
registry-url: https://registry.npmjs.org
- name: Get yarn cache directory path
run: echo "::set-output name=dir::$(yarn cache dir)"
id: step_3
- name: Enable Cache
uses: actions/cache@v4
with:
path: |-
${{ steps.step_3.outputs.dir }}
node_modules
packages/*/node_modules
key: ${{ runner.os }}-24.x-${{ hashFiles('yarn.lock') }}-2
- run: yarn install --prefer-offline
- run: yarn build
- run: npm install
- run: node --run build
- run: npx rollingversions publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading
Loading