-
Notifications
You must be signed in to change notification settings - Fork 83
127 lines (112 loc) · 4.34 KB
/
kind-e2e-tests.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: E2E Tests on Kind
on:
schedule:
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
pull_request_target:
types: [ opened, synchronize, reopened ]
paths:
- "**.go"
jobs:
e2e-tests:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
name: e2e tests
runs-on: ubuntu-latest
env:
KO_DOCKER_REPO: localhost:5000
CONTROLLER_DOMAIN_URL: controller.paac-127-0-0-1.nip.io
TEST_GITHUB_REPO_OWNER_GITHUBAPP: openshift-pipelines/pipelines-as-code-e2e-tests
KUBECONFIG: /home/runner/.kube/config.kind
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- uses: ko-build/[email protected]
- name: Install gosmee
uses: jaxxstorm/[email protected]
with:
repo: chmouel/gosmee
- name: Run gosmee
run: |
nohup gosmee client --saveDir /tmp/gosmee-replay ${{ secrets.PYSMEE_URL }} "http://${CONTROLLER_DOMAIN_URL}" &
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
detached: true
limit-access-to-actor: true
- name: Start installing cluster
run: |
export PAC_DIR=${PWD}
export TEST_GITEA_SMEEURL="${{ secrets.TEST_GITEA_SMEEURL }}"
bash -x ./hack/dev/kind/install.sh
- name: Create PAC github-app-secret
run: |
./hack/gh-workflow-ci.sh create_pac_github_app_secret \
"${{ secrets.APP_PRIVATE_KEY }}" \
"${{ secrets.APPLICATION_ID }}" \
"${{secrets.WEBHOOK_SECRET }}"
- name: Create second Github APP Controller on GHE
run: |
./hack/gh-workflow-ci.sh create_second_github_app_controller_on_ghe \
"${{ secrets.TEST_GITHUB_SECOND_SMEE_URL }}" \
"${{ secrets.TEST_GITHUB_SECOND_PRIVATE_KEY }}" \
"${{ secrets.TEST_GITHUB_SECOND_WEBHOOK_SECRET }}"
- name: Run E2E Tests on pull_request
if: ${{ github.event_name != 'schedule' }}
run: |
./hack/gh-workflow-ci.sh run_e2e_tests \
"${{ secrets.BITBUCKET_CLOUD_TOKEN }}" \
"${{ secrets.WEBHOOK_SECRET }}" \
"${{ secrets.TEST_GITEA_SMEEURL }}" \
"${{ secrets.INSTALLATION_ID }}" \
"${{ secrets.GH_APPS_TOKEN }}" \
"${{ secrets.TEST_GITHUB_SECOND_TOKEN }}" \
"${{ secrets.GITLAB_TOKEN }}" \
"${{ secrets.BITBUCKET_SERVER_TOKEN }}" \
"${{ secrets.BITBUCKET_SERVER_API_URL }}" \
"${{ secrets.BITBUCKET_SERVER_WEBHOOK_SECRET }}"
- name: Run E2E Tests on nightly
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
export NIGHTLY_E2E_TEST="true"
./hack/gh-workflow-ci.sh run_e2e_tests \
"${{ secrets.BITBUCKET_CLOUD_TOKEN }}" \
"${{ secrets.WEBHOOK_SECRET }}" \
"${{ secrets.TEST_GITEA_SMEEURL }}" \
"${{ secrets.INSTALLATION_ID }}" \
"${{ secrets.GH_APPS_TOKEN }}" \
"${{ secrets.TEST_GITHUB_SECOND_TOKEN }}" \
"${{ secrets.GITLAB_TOKEN }}" \
"${{ secrets.BITBUCKET_SERVER_TOKEN }}" \
"${{ secrets.BITBUCKET_SERVER_API_URL }}" \
"${{ secrets.BITBUCKET_SERVER_WEBHOOK_SECRET }}"
- name: Collect logs
if: ${{ always() }}
run: |
./hack/gh-workflow-ci.sh collect_logs
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: logs
path: /tmp/logs
- name: Report Status
if: ${{ always() && github.ref_name == 'main' && github.event_name == 'schedule' }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}