diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fa1fc8..79acc5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/build/tasks.js b/build/tasks.js index e03e962..b88816a 100644 --- a/build/tasks.js +++ b/build/tasks.js @@ -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,13 +31,20 @@ 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); - console.log( - `::group::@flecks/${ + if (!showSuccess && 0 === code) { + console.log(`@flecks/${ chalk.blue(relative(join(FLECKS_CORE_ROOT, 'packages'), cwd)) - } ${0 === code ? chalk.green('passed') : chalk.red('failed')}`, - ); - process.stdout.write(await buffer); - console.log('::endgroup::\n'); + } ${chalk.green('passed')}\n`); + } + else { + console.log( + `::group::@flecks/${ + chalk.blue(relative(join(FLECKS_CORE_ROOT, 'packages'), cwd)) + } ${0 === code ? chalk.green('passed') : chalk.red('failed')}`, + ); + process.stdout.write(await buffer); + console.log('::endgroup::\n'); + } return code; }, );