ci: local nice

This commit is contained in:
cha0s 2024-02-15 22:44:33 -06:00
parent bf73b78ed7
commit ed73e3a8f3
2 changed files with 20 additions and 10 deletions

View File

@ -2,7 +2,7 @@ name: CI
on:
push:
branches: [master]
branches: [bleeding, master]
pull_request:
branches: [master]
workflow_dispatch: {}
@ -31,7 +31,7 @@ jobs:
key: ${{ hashFiles('**/package-lock.json') }}
- if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: npm ci
- run: npm run build
- run: FLECKS_CI_SHOW_SUCCESS=1 npm run build
test:
runs-on: ubuntu-latest
@ -65,7 +65,7 @@ jobs:
if: ${{ vars.NPM_CI_REGISTRY && steps.cache-node-modules.outputs.cache-hit != 'true' }}
- run: npm ci
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
- run: npm run -- test -t 120000 ${{ matrix.test-platforms }}
- run: FLECKS_CI_SHOW_SUCCESS=1 npm run -- test -t 120000 ${{ matrix.test-platforms }}
lint:
runs-on: ubuntu-latest
@ -85,4 +85,4 @@ jobs:
key: ${{ hashFiles('**/package-lock.json') }}
- if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: npm ci
- run: npm run lint
- run: FLECKS_CI_SHOW_SUCCESS=1 npm run lint

View File

@ -9,11 +9,14 @@ const concurrent = require('./concurrent');
const {
FLECKS_CORE_ROOT = process.cwd(),
FLECKS_CI_SHOW_SUCCESS,
} = process.env;
const args = process.argv.slice(2);
const {workspaces} = require(join(FLECKS_CORE_ROOT, 'package.json'));
const showSuccess = !!FLECKS_CI_SHOW_SUCCESS;
(async () => {
process.exitCode = await concurrent(
(await Promise.all(workspaces.map((path) => glob(join(FLECKS_CORE_ROOT, path))))).flat(),
@ -28,6 +31,12 @@ const {workspaces} = require(join(FLECKS_CORE_ROOT, 'package.json'));
const stdio = new PassThrough();
const buffer = pipesink(child.stderr.pipe(child.stdout.pipe(stdio)));
const code = await processCode(child);
if (!showSuccess && 0 === code) {
console.log(`@flecks/${
chalk.blue(relative(join(FLECKS_CORE_ROOT, 'packages'), cwd))
} ${chalk.green('passed')}\n`);
}
else {
console.log(
`::group::@flecks/${
chalk.blue(relative(join(FLECKS_CORE_ROOT, 'packages'), cwd))
@ -35,6 +44,7 @@ const {workspaces} = require(join(FLECKS_CORE_ROOT, 'package.json'));
);
process.stdout.write(await buffer);
console.log('::endgroup::\n');
}
return code;
},
);