From 1120e3034d3f508ab822d9b378daab88517b8f7d Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Tue, 4 Jun 2024 15:23:08 +0200 Subject: [PATCH] ci: remove branch filter (#519) * ci: remove branch filter Signed-off-by: Vincenzo Scamporlino * ci: always verify noop workspace Signed-off-by: Vincenzo Scamporlino --------- Signed-off-by: Vincenzo Scamporlino --- .github/workflows/ci.yml | 2 -- scripts/ci/list-workspaces-with-changes.js | 32 +++++++++++----------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8f0cad309..41c1d5d028 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,6 @@ name: CI on: pull_request: - paths: - - "workspaces/**" concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/scripts/ci/list-workspaces-with-changes.js b/scripts/ci/list-workspaces-with-changes.js index ab03d76236..ce771a922b 100644 --- a/scripts/ci/list-workspaces-with-changes.js +++ b/scripts/ci/list-workspaces-with-changes.js @@ -1,13 +1,13 @@ -import { execFile as execFileCb } from 'child_process'; -import { promises as fs } from 'fs'; -import { promisify } from 'util'; -import { resolve as resolvePath } from 'path'; -import { EOL } from 'os'; +import { execFile as execFileCb } from "child_process"; +import { promises as fs } from "fs"; +import { promisify } from "util"; +import { resolve as resolvePath } from "path"; +import { EOL } from "os"; -import * as url from 'url'; -const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); +import * as url from "url"; +const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); -const parentRef = process.env.COMMIT_SHA_BEFORE || 'origin/main'; +const parentRef = process.env.COMMIT_SHA_BEFORE || "origin/main"; const execFile = promisify(execFileCb); @@ -23,24 +23,24 @@ async function runPlain(cmd, ...args) { throw error; } throw new Error( - `Command '${[cmd, ...args].join(' ')}' failed with code ${error.code}` + `Command '${[cmd, ...args].join(" ")}' failed with code ${error.code}` ); } } async function main() { if (!process.env.GITHUB_OUTPUT) { - throw new Error('GITHUB_OUTPUT environment variable not set'); + throw new Error("GITHUB_OUTPUT environment variable not set"); } - const repoRoot = resolvePath(__dirname, '..', '..'); + const repoRoot = resolvePath(__dirname, "..", ".."); process.chdir(repoRoot); - const diff = await runPlain('git', 'diff', '--name-only', parentRef); + const diff = await runPlain("git", "diff", "--name-only", parentRef); - const packageList = diff.split('\n'); + const packageList = diff.split("\n"); - const workspaces = new Set(); + const workspaces = new Set(["noop"]); for (const path of packageList) { const match = path.match(/^workspaces\/([^/]+)\//); if (match) { @@ -48,7 +48,7 @@ async function main() { } } - console.log('workspaces found with changes:', Array.from(workspaces)); + console.log("workspaces found with changes:", Array.from(workspaces)); for (const workspace of workspaces) { if ( @@ -60,7 +60,7 @@ async function main() { } } - console.log('workspaces that exist:', Array.from(workspaces)); + console.log("workspaces that exist:", Array.from(workspaces)); await fs.appendFile( process.env.GITHUB_OUTPUT,