ci: Additionally checkout PR head for e2e tests (no-changelog) (#6105)

* ci: Do not force branch for PR e2e smoke tests

* Use commit SHA for smoke test

* Debug: Echo git before running e2e

* Debugging: Create local merge commit

* Use container with git installed

* Debugging: Manual git checkout PR

* Do not skip checkout

* Use container with git installed

* Add breaking test, install git manualyl

* Use sudo

* Use container with git preinstalled

* Remove debugging e2e
This commit is contained in:
OlegIvaniv 2023-04-27 13:09:50 +02:00 committed by GitHub
parent 59aee2270b
commit e4356283a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View file

@ -112,12 +112,13 @@ jobs:
name: E2E [Electron/Node 16] name: E2E [Electron/Node 16]
uses: ./.github/workflows/e2e-reusable.yml uses: ./.github/workflows/e2e-reusable.yml
with: with:
branch: ${{ github.event.pull_request.head.ref }} branch: ${{ github.event.pull_request.base.ref }}
user: ${{ github.event.inputs.user || 'PR User' }} user: ${{ github.event.inputs.user || 'PR User' }}
spec: ${{ github.event.inputs.spec || 'e2e/0-smoke.cy.ts' }} spec: ${{ github.event.inputs.spec || 'e2e/0-smoke.cy.ts' }}
run-env: base:16.18.1 run-env: browsers:node16.18.0-chrome107-ff106-edge
record: false record: false
parallel: false parallel: false
pr_number: ${{ github.event.number }}
containers: '[1]' containers: '[1]'
secrets: secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

View file

@ -7,7 +7,6 @@ on:
description: 'GitHub branch to test.' description: 'GitHub branch to test.'
required: false required: false
type: string type: string
default: 'master'
user: user:
description: 'User who kicked this off.' description: 'User who kicked this off.'
required: false required: false
@ -43,6 +42,10 @@ on:
required: false required: false
default: '[1, 2, 3, 4, 5, 6, 7, 8]' default: '[1, 2, 3, 4, 5, 6, 7, 8]'
type: string type: string
pr_number:
description: 'PR number to run tests for.'
required: false
type: number
secrets: secrets:
CYPRESS_RECORD_KEY: CYPRESS_RECORD_KEY:
description: 'Cypress record key.' description: 'Cypress record key.'
@ -79,6 +82,12 @@ jobs:
repository: n8n-io/n8n repository: n8n-io/n8n
ref: ${{ inputs.branch }} ref: ${{ inputs.branch }}
- name: Checkout PR
if: ${{ inputs.pr_number }}
run: |
git fetch origin pull/${{ inputs.pr_number }}/head
git checkout FETCH_HEAD
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v2.2.4 uses: pnpm/action-setup@v2.2.4
with: with:
@ -123,6 +132,12 @@ jobs:
repository: n8n-io/n8n repository: n8n-io/n8n
ref: ${{ inputs.branch }} ref: ${{ inputs.branch }}
- name: Checkout PR
if: ${{ inputs.pr_number }}
run: |
git fetch origin pull/${{ inputs.pr_number }}/head
git checkout FETCH_HEAD
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v2.2.4 uses: pnpm/action-setup@v2.2.4