generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 23
85 lines (71 loc) · 2.82 KB
/
pr-lifecycle.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: PR Lifecycle
on:
pull_request:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- 'dependencies/**'
- '**/*.md'
- 'OWNERS'
- 'CODEOWNERS'
workflow_dispatch:
jobs:
manager-upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Golang
uses: "./.github/template/setup-golang"
- name: Provision K3D
shell: bash
run: make provision-k3d
- name: Deploy with latest tag
shell: bash
run: |
git fetch --tags
LATEST_TAG=$(git tag --sort=-creatordate | sed -n 1p)
echo "Using tag ${LATEST_TAG}"
git checkout ${LATEST_TAG}
GIT_COMMIT_SHA=$(git rev-parse --short=8 HEAD)
GIT_COMMIT_DATE=$(git show -s --format=%cd --date=format:'v%Y%m%d' ${GIT_COMMIT_SHA})
echo "Deploying Manager using image europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA}"
IMG=europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA} make deploy-dev
- name: Wait for manager readiness
shell: bash
run: kubectl -n kyma-system rollout status deployment telemetry-manager --timeout=90s
- name: Run test on latest tag
shell: bash
run: |
bin/ginkgo run --junit-report=junit-report-latest-version.xml --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
- name: Switch back to current revision
uses: actions/checkout@v4
- name: Wait for cleanup of test run
shell: bash
run: hack/wait-for-namespaces.sh
# wait for the build to complete so that the manager image is available
- name: Wait for the Build Image workflow to complete
run: "./hack/await_workflow.sh"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
COMMIT_SHA: "${{ github.event.pull_request.head.sha }}"
- name: Deploy with current version
shell: bash
run: |
IMG=europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:PR-${{ github.event.number }} make deploy-dev
- name: Wait for manager readiness
shell: bash
run: kubectl -n kyma-system rollout status deployment telemetry-manager --timeout=90s
- name: Run test on current version
shell: bash
run: |
make install-tools # delete after the tools via go modules are released
bin/ginkgo run --junit-report=junit-report-current-version.xml --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
- name: Finalize test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
job-name: ${{ github.job }}