-
Notifications
You must be signed in to change notification settings - Fork 1.1k
61 lines (53 loc) · 1.94 KB
/
automation-tests-on-repository-dispatch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Execute automation tests
run-name: Run tests on ${{github.event.client_payload.custom_version }} ${{github.event.client_payload.project}}
on:
repository_dispatch:
types: [automation-tests-event]
jobs:
get-environment-variables:
runs-on: ubuntu-22.04
timeout-minutes: 30
outputs:
VERSION: ${{ steps.get-environment-variables.outputs.version }}
env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_VERSION: ${{github.event.client_payload.custom_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Install dependencies
run: |
cd .github/workflows
npm ci
- name: get environment variables
id: get-environment-variables
run: |
node .github/workflows/getEnvironmentVariables.js \
--custom_version "$CUSTOM_VERSION" \
--repo_token "$REPO_TOKEN"
run-tests-on-release:
needs: get-environment-variables
uses: ./.github/workflows/run-tests-on-release.yml
with:
VERSION: ${{needs.get-environment-variables.outputs.VERSION}}
CUSTOM_VERSION: ${{github.event.client_payload.custom_version }}
ADDITIONAL_TITLE: "Core automation test"
secrets: inherit
add-comment-to-release-pr:
if: ${{ !cancelled() }}
needs: run-tests-on-release
runs-on: ubuntu-22.04
steps:
- name: add-comment-to-release-pr
env:
PR_NUMBER: ${{github.event.client_payload.release_pr }}
PR_COMMENT: ${{needs.run-tests-on-release.outputs.PR_COMMENT}}
run: |
export GITHUB_TOKEN=$( \
curl --request GET --url ${{ secrets.VAULT_URL}} --header "Authorization: JWT ${{ secrets.VAULT_JWT }}" | jq -r .token \
)
gh pr comment "$PR_NUMBER" --body "$PR_COMMENT" -R github.com/saleor/saleor-cloud-deployments