From ad92827fa794da108328b4782bf1a63220c5c086 Mon Sep 17 00:00:00 2001 From: Cedric Willekens Date: Thu, 18 Apr 2024 15:39:41 +0200 Subject: [PATCH 1/2] Fix gha smells - Avoid running CI related actions when no source code has changed - Use 'if' for upload-artifact action - Avoid running CI related actions when no source code has changed - Stop running workflwos when there is a newer commit in PR --- .github/workflows/canary-release.yml | 20 ++++++++++++++++++++ .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ .github/workflows/release.yml | 1 + 3 files changed, 45 insertions(+) diff --git a/.github/workflows/canary-release.yml b/.github/workflows/canary-release.yml index 0d06fffde50..90c1b1a693c 100644 --- a/.github/workflows/canary-release.yml +++ b/.github/workflows/canary-release.yml @@ -7,6 +7,26 @@ on: push: branches: - v2 + paths: + - yarn.lock + - verdaccioPublish.js + - verdaccio.yml + - rustfmt.toml + - rust-toolchain + - README.md + - package.json + - lerna.json + - gulpfile.js + - Cargo.toml + - Cargo.lock + - babel.config.json + - sciprts/** + - patches/** + - packages/** + - flow-typed/** + - flow-libs/** + - docs/** + - crates/** workflow_dispatch: jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46e9ff57702..f3991d9a4af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,34 @@ on: push: branches: - v2 + paths: + - yarn.lock + - verdaccioPublish.js + - verdaccio.yml + - rustfmt.toml + - rust-toolchain + - README.md + - package.json + - lerna.json + - gulpfile.js + - Cargo.toml + - Cargo.lock + - babel.config.json + - sciprts/** + - patches/** + - packages/** + - flow-typed/** + - flow-libs/** + - docs/** + - crates/** permissions: contents: read +concurrency: + group: ${{ github.workflow }} - ${{ github.ref }} + cancel-in-progress: true + jobs: lint: name: Lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d00dcbbd5c2..f973e1156b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,6 +66,7 @@ jobs: run: strip -x packages/*/*/*.node # Must use -x on macOS. This produces larger results on linux. - name: Upload artifacts uses: actions/upload-artifact@v3 + if: ${{github.repository == 'parcel-bundler/parcel' && success()}} with: name: bindings-${{ matrix.name }} path: packages/*/*/*.node From 54ea60666448114da43f5288dc73f26fac72e0ec Mon Sep 17 00:00:00 2001 From: Cedric Willekens Date: Wed, 1 May 2024 09:08:35 +0200 Subject: [PATCH 2/2] Fix typo in paths for canary-release and ci Signed-off-by: Cedric Willekens --- .github/workflows/canary-release.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/canary-release.yml b/.github/workflows/canary-release.yml index 90c1b1a693c..4f82e581844 100644 --- a/.github/workflows/canary-release.yml +++ b/.github/workflows/canary-release.yml @@ -20,7 +20,7 @@ on: - Cargo.toml - Cargo.lock - babel.config.json - - sciprts/** + - scripts/** - patches/** - packages/** - flow-typed/** diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3991d9a4af..627b491f2c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ on: - Cargo.toml - Cargo.lock - babel.config.json - - sciprts/** + - scripts/** - patches/** - packages/** - flow-typed/**