n8n/.github/workflows/units-tests-dispatch.yml
कारतोफ्फेलस्क्रिप्ट™ 31281a3f6b
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
ci: Run Frontend tests on master only on node 20 (no-changelog) (#12833)
2025-01-24 16:33:00 +01:00

46 lines
1.2 KiB
YAML

name: Runs unit tests for a given ref
on:
workflow_dispatch:
inputs:
ref:
description: 'GitHub ref to test.'
required: false
default: 'master'
type: string
prNumber:
description: 'PR number to run tests for.'
required: false
type: number
skipFrontendTests:
description: 'Skip Frontend tests'
required: false
default: false
type: boolean
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.compute-branch.outputs.branch }}
steps:
- name: Compute branch
id: compute-branch
run: |
BRANCH_NAME=""
if [[ "${{ inputs.prNumber }}" != "" && "${{ inputs.prNumber }}" != "null" ]]; then
BRANCH_NAME="refs/pull/${{ inputs.prNumber }}/merge"
else
BRANCH_NAME="${{ inputs.ref }}"
fi
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
unit-test:
name: Unit tests
needs: prepare
uses: ./.github/workflows/units-tests-reusable.yml
with:
ref: ${{ needs.prepare.outputs.branch }}
skipFrontendTests: ${{ inputs.skipFrontendTests }}