From e755cada50c381b4f5f03948bc753bc26ba586d4 Mon Sep 17 00:00:00 2001 From: mikhail-klimko Date: Thu, 21 Sep 2023 00:47:46 +0300 Subject: [PATCH] add codefresh-run-e2e action (#649) --- .github/pull_request_template.md | 5 +++ .github/workflows/codefresh-run-e2e.yaml | 53 ++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/codefresh-run-e2e.yaml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..cf8675a53 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,5 @@ +## What + +## Why + +## Notes \ No newline at end of file diff --git a/.github/workflows/codefresh-run-e2e.yaml b/.github/workflows/codefresh-run-e2e.yaml new file mode 100644 index 000000000..32e9d4cfa --- /dev/null +++ b/.github/workflows/codefresh-run-e2e.yaml @@ -0,0 +1,53 @@ +name: Steps Test + +on: + pull_request: + branches: + - master + +env: + PIPELINE_NAME: "cli-v1-e2e/codefresh-run-step-e2e" + TRIGGER_NAME: "codefresh_run_step_dev" + +jobs: + codefresh_run_test: + runs-on: ubuntu-latest + steps: + - id: clone + uses: actions/checkout@v4 + with: + repository: ${{ github.repository }} + ref: ${{ github.ref }} + fetch-depth: 0 + + - id: base-sha + run: | + echo "result=$(git rev-parse --short origin/master)" >> $GITHUB_OUTPUT + + - id: git-branch-name + uses: ohueter/normalize-git-branch-name@v1 + with: + ref: ${{ github.ref }} + head-ref: ${{ github.head_ref }} + + - id: changed-files + uses: tj-actions/changed-files@v39 + with: + base_sha: ${{ steps.base-sha.outputs.result }} + json: true + escape_json: false + files: | + graduated/codefresh-run/** + + - id: setup-node + if: steps.changed-files.outputs.any_changed == 'true' + uses: actions/setup-node@v3 + with: + node-version: 18 + + - id: codefresh-run + if: steps.changed-files.outputs.any_changed == 'true' + run: | + npm install -g codefresh + codefresh auth create-context --api-key ${{ secrets.CF_API_KEY }} + codefresh run ${{ env.PIPELINE_NAME }} -t ${{ env.TRIGGER_NAME }} -b ${{ steps.git-branch-name.outputs.original_name }}