From a2ffb29b6bd4e04dc7e4877bcbcf129a56d66fa5 Mon Sep 17 00:00:00 2001 From: Liora Milbaum Date: Sun, 20 Aug 2023 09:29:13 +0300 Subject: [PATCH] feat: run GHA build job locally with act --- .github/actions/setup-node/action.yml | 11 ++++++++--- .github/workflows/build.yml | 1 + docs/development/local-development.md | 9 +++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index ed2234d606b6d9..06b73cce4d75f2 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -47,9 +47,10 @@ runs: (steps.node-modules-restore.outputs.cache-hit == 'true') && 'true' || '' }}' >> "$GITHUB_ENV" - - name: Enable corepack - shell: bash - run: corepack enable + - name: Install pnpm + uses: pnpm/action-setup@v2.4.0 + with: + version: 8.6.12 - name: Setup Node uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 @@ -57,6 +58,10 @@ runs: node-version: ${{ inputs.node-version }} cache: ${{ env.CACHE_HIT != 'true' && 'pnpm' || '' }} + - name: Enable corepack + shell: bash + run: corepack enable + - name: Install dependencies uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 if: env.CACHE_HIT != 'true' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe0c12d0785eb1..2d1f8180e5fb5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -462,6 +462,7 @@ jobs: - name: Upload uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + if: ${{ !env.ACT }} with: name: renovate-package path: renovate-0.0.0-semantic-release.tgz diff --git a/docs/development/local-development.md b/docs/development/local-development.md index c9874fbcdecd11..dc52c45e910352 100644 --- a/docs/development/local-development.md +++ b/docs/development/local-development.md @@ -81,6 +81,15 @@ Then you can run `pnpm` directly from Docker, for instance: docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app renovatebot_local pnpm install ``` +## Run GitHub Action build job locally with act + +1. Install act - [installation instructions](https://github.com/nektos/act#installation) +1. Run + +``` +act -W .github/workflows/build.yml -j build +``` + ## Fork and Clone If you want to contribute to the project, you should first "fork" the main project using the GitHub website and then clone your fork locally.