-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ECOPROJECT-2327: Add Github action to validate PRs before merge it to…
… main (#40) * Add Github action to validate PRs before merge it to main Signed-off-by: Montse Ortega <[email protected]> * Solving lint problems Signed-off-by: Montse Ortega <[email protected]> * Order of checks in PR Signed-off-by: Montse Ortega <[email protected]> --------- Signed-off-by: Montse Ortega <[email protected]>
- Loading branch information
Showing
5 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Pull request | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
branches: | ||
- main | ||
- releases/* | ||
|
||
env: | ||
NODE_OPTIONS: '--max-old-space-size=8192' | ||
# See https://github.com/cypress-io/cypress/issues/25357 | ||
ELECTRON_EXTRA_LAUNCH_ARGS: --disable-gpu | ||
jobs: | ||
preflight-check: | ||
# Prevents running the workflow when a PR is marked as draft. | ||
runs-on: ubuntu-latest | ||
outputs: | ||
skip: ${{ steps.check.outputs.skip }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Enable Corepack | ||
run: | | ||
corepack enable | ||
corepack prepare [email protected] --activate | ||
- name: Check if PR is draft | ||
id: check | ||
run: | | ||
if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then | ||
skip=true | ||
else | ||
skip=false | ||
fi | ||
echo "skip=${skip}" >> $GITHUB_OUTPUT | ||
echo "skip=${skip}" | ||
lint-and-build: | ||
# Execute lint and build when a PR is ready | ||
needs: preflight-check | ||
if: needs.preflight-check.outputs.skip == 'false' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Enable Corepack | ||
run: | | ||
corepack enable | ||
corepack prepare [email protected] --activate | ||
- run: yarn install --immutable | ||
- run: yarn all:lint | ||
- run: yarn all:build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters