Skip to content

Commit

Permalink
Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
karola312 committed May 13, 2024
1 parent 2eb4f9f commit afe82a7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 27 deletions.
9 changes: 2 additions & 7 deletions .github/actions/checks/create-pull-request-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ inputs:
DETAILS_URL:
description: "Details url"
required: true
REPOSITORY:
description: "On witch repository add check "
required: false

outputs:
CHECK_ID:
Expand All @@ -33,12 +30,11 @@ runs:
env:
GH_TOKEN: ${{ github.token }}
PR_HEAD: ${{ inputs.PR_HEAD }}
REPOSITORY: ${{ inputs.REPOSITORY || "saleor-dashboard" }}
run: |
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/saleor/${REPOSITORY}/pulls?head=saleor:${PR_HEAD}" > data.json
"/repos/saleor/saleor-dashboard/pulls?head=saleor:${PR_HEAD}" > data.json
head_sha_with_quotes=$(jq '.[0] | .head.sha' data.json)
echo "PULL_REQUEST_HEAD_SHA=${head_sha_with_quotes//\"/}" >> "$GITHUB_ENV"
Expand All @@ -51,7 +47,6 @@ runs:
NAME: ${{ inputs.CHECK_NAME }}
STATUS: ${{ inputs.STATUS }}
TITLE: ${{ inputs.TITLE }}
REPOSITORY: ${{ inputs.REPOSITORY || "saleor-dashboard" }}

run: |
payload=$(\
Expand Down Expand Up @@ -79,5 +74,5 @@ runs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$REPOSITORY/saleor-dashboard/check-runs \
https://api.github.com/repos/saleor-dashboard/saleor-dashboard/check-runs \
-d "$payload" | jq -r '.id') ; echo "check_id=$check_id" >> "$GITHUB_OUTPUT"
6 changes: 1 addition & 5 deletions .github/actions/checks/update-pull-request-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ inputs:
DETAILS_URL:
description: "Url with details to check"
required: true
REPOSITORY:
description: "Repository"
required: false

runs:
using: composite
Expand All @@ -40,7 +37,6 @@ runs:
TITLE: ${{ inputs.TITLE }}
SUMMARY: ${{ inputs.SUMMARY }}
DETAILS_URL: ${{ inputs.DETAILS_URL }}
REPOSITORY: ${{ inputs.REPOSITORY || "saleor-dashboard" }}
run: |
payload=$(\
Expand Down Expand Up @@ -69,5 +65,5 @@ runs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$REPOSITORY/saleor-dashboard/check-runs/$CHECK_ID" \
"https://api.github.com/repos/saleor-dashboard/saleor-dashboard/check-runs/$CHECK_ID" \
-d "$payload"
35 changes: 32 additions & 3 deletions .github/workflows/automation-tests-on-repository-dispatch.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Execute automation tests
run-name: Run tests on ${{github.event.client_payload.version}} ${{github.event.client_payload.project}}
run-name: Run tests on ${{github.event.client_payload.custom_version}} ${{github.event.client_payload.project}}

on:
repository_dispatch:
Expand Down Expand Up @@ -41,6 +41,35 @@ jobs:
with:
VERSION: ${{needs.get-environment-variables.outputs.VERSION}}
CUSTOM_VERSION: ${{github.event.client_payload.custom_version}}
HEAD_SHA_OF_RELEASE_PR: ${{github.event.client_payload.release_pr_head_sha}}
secrets: inherit


create-release-PR:
needs: run-tests-on-release
if: ${{ needs.run-tests-on-release.outputs.TESTS_CONCLUSION == 'success'}} && ${{github.event.client_payload.project == 'CORE' }}
runs-on: ubuntu-22.04
steps:
- name: Open release PR
run: |
export GITHUB_TOKEN=$( \
curl --request GET --url ${{ secrets.VAULT_URL}} --header "Authorization: JWT ${{ secrets.VAULT_JWT }}" | jq -r .token \
)
payload=$(\
jq --null-input \
--arg version "$CURRENT_VERSION" \
--arg details_url_to_test_run "$RUN_URL" \
--arg test_status "$STATUS" \
'{
"project": "CORE",
"environment": "SANDBOX",
"version": $version
"details_url_to_test_run": $details_url_to_test_run
"test_status": $test_status
}'
)
gh api /repos/saleor/saleor-cloud-deployments/dispatches \
--input - <<< '{
"event_type": "open-release-pull-request",
"client_payload": "$payload"
}'
23 changes: 11 additions & 12 deletions .github/workflows/run-tests-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ on:
type: string
required: true
description: Version of run eg. "3.19.4-5a41d18"
HEAD_SHA_OF_RELEASE_PR:
PROJECT:
type: string
required: false
description: head sha of release pr if triggered for core release
CHECK_REPOSITORY:
type: string
required: false
description: repository for check, required if different than saleor-dashboard
description: release project

secrets:
STAGING_TOKEN:
Expand All @@ -36,6 +32,10 @@ on:
required: true
SLACK_QA_STATUSES_WEBHOOK_URL:
required: true

outputs:
TESTS_CONCLUSION: ${{ jobs.tests-complete.outputs.TESTS_CONCLUSION }}
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

jobs:
add-check-and-prepare-instance:
Expand All @@ -61,12 +61,11 @@ jobs:
id: create-check
uses: ./.github/actions/checks/create-pull-request-check
with:
PR_HEAD: ${{inputs.HEAD_SHA_OF_RELEASE_PR }} | "changeset-release/${{env.MINOR_VERSION}}"
PR_HEAD: "changeset-release/${{env.MINOR_VERSION}}"
CHECK_NAME: "Automation_tests_run"
STATUS: "in_progress"
TITLE: "Automation tests run"
DETAILS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
REPOSITORY: ${{inputs.CHECK_REPOSITORY }}

- name: Generate variables
id: cloud_variables
Expand Down Expand Up @@ -129,11 +128,13 @@ jobs:
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunId: ${{ needs.add-check-and-prepare-instance.outputs.TESTMO_RUN_ID }}

tests-complete-pw:
tests-complete:
if: |
!cancelled()
needs: ["add-check-and-prepare-instance", "run-pw-tests"]
runs-on: ubuntu-22.04
outputs:
TESTS_CONCLUSION: "${{ steps.send-slack-message.outputs.status }}"
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -177,7 +178,6 @@ jobs:
TITLE: "Automation tests run"
SUMMARY: "${{ steps.send-slack-message.outputs.message }}. Run details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
DETAILS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
REPOSITORY: ${{inputs.CHECK_REPOSITORY }}

update-check-status-if-previous-job-fails:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -209,5 +209,4 @@ jobs:
CONCLUSION: "failure"
TITLE: "Automation tests run"
SUMMARY: "Run failed"
DETAILS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
REPOSITORY: ${{inputs.CHECK_REPOSITORY }}
DETAILS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

0 comments on commit afe82a7

Please sign in to comment.