-
Notifications
You must be signed in to change notification settings - Fork 13
155 lines (129 loc) · 4.65 KB
/
pr-check.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: PR Check Test
on:
pull_request:
branches:
- main
jobs:
# Do we want to have this or similar check or run by default?
# check-org-membership:
# runs-on: ubuntu-latest
# outputs:
# org-member: ${{ steps.org-check.outputs.org-member }}
# steps:
# - name: Check if PR author is a member of the organization
# continue-on-error: true
# id: org-check
# run: |
# ORG="${{ github.repository_owner }}"
# AUTHOR="${{ github.event.pull_request.user.login }}"
# if ! gh api /orgs/$ORG/members/$AUTHOR; then
# echo '### ❌ PR author is not a member of GitHub organization' >> $GITHUB_STEP_SUMMARY
# exit 1
# fi
# echo "org-member=true" >> $GITHUB_OUTPUT
# env:
# GITHUB_TOKEN: ${{ secrets.HAC_TEST_GH_TOKEN }}
e2e-test:
# if: ${{ (needs.check-org-membership.outputs.org-member == 'true') || (github.event.pull_request.user.login == 'renovate[bot]') || contains(github.event.pull_request.labels.*.name, 'ok-to-test') }}
# needs: check-org-membership
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
docker-images: false
- name: Checkout Repository
uses: actions/checkout@v4
with:
repository: 'konflux-ci/konflux-ci'
ref: 'main'
- name: Disable AppArmor
# works around a change in ubuntu 24.04 that restricts Linux namespace access
# for unprivileged users
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
with:
config: kind-config.yaml
- name: Show version information
run: |
kubectl version
kind version
- name: List namespaces
run: |
kubectl get namespace
- name: Deploying Dependencies
run: |
./deploy-deps.sh
- name: List namespaces
run: |
kubectl get namespace
- name: Wait for the dependencies to be ready
run: |
./wait-for-all.sh
- name: WORKAROUND - Set up tkn cli for the following task
uses: tektoncd/actions/setup-tektoncd-cli@main
with:
version: latest
- name: WORKAROUND - Remove clair-scan task from docker-pipeline
run: |
./test/e2e/customize-docker-pipeline.sh
- name: Deploying Konflux
run: |
./deploy-konflux.sh
- name: List namespaces
run: |
kubectl get namespace
- name: Deploy test resources
run: |
./deploy-test-resources.sh
- name: Prepare resources for E2E tests
# Sets secrets, deploys image controller and setup smee.
env:
APP_ID: ${{ secrets.GH_APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
APP_WEBHOOK_SECRET: ${{ secrets.GH_APP_WEBHOOK_SECRET }}
QUAY_ORG: ${{ secrets.QUAY_TEST_ORG }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN_TEST }}
SMEE_CHANNEL: ${{ secrets.SMEE_URL }}
run: |
./test/e2e/prepare-e2e.sh
- name: Checkout Konflux-UI Repository
uses: actions/checkout@v4
with:
repository: 'konflux-ci/konflux-ui'
- name: Install konflux-ui
run: |
cd konflux-ui
yarn install
yarn start
- name: Run E2E tests
env:
GH_ORG: ${{ secrets.GH_ORG }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
QUAY_DOCKERCONFIGJSON: ${{ secrets.QUAY_DOCKERCONFIGJSON }}
run: |
TEST_IMAGE="quay.io/konflux_ui_qe/konflux-ui-tests:latest"
#Rebuild test image if Dockerfile from e2e-tests was changed
if ! git diff --exit-code --quiet origin/$ghprbTargetBranch HEAD -- e2e-tests/Dockerfile; then
echo "Dockerfile changes detected, rebuilding test image"
TEST_IMAGE="konflux-ui-tests:pr-${ghprbPullId}"
cd e2e-tests
podman build -t "$TEST_IMAGE" . -f Dockerfile
cd ..
fi
cd konflux-ui/e2e-tests
echo "running tests using image ${TEST_IMAGE}"
# - name: Generate error logs
# if: ${{ !cancelled() }}
# run: |
# ./generate-err-logs.sh
# - name: Archive logs
# if: ${{ !cancelled() }}
# uses: actions/upload-artifact@v4
# with:
# name: logs
# path: logs