-
Notifications
You must be signed in to change notification settings - Fork 28
73 lines (65 loc) · 2.12 KB
/
pull-request-release.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
name: Release Pull Request
on:
pull_request_target:
types: [ synchronize, opened, reopened, ready_for_review ]
branches:
- 'release-**'
jobs:
build-image:
name: Build manager image
if: github.event.pull_request.draft == false
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: api-gateway/pr/api-gateway-manager
dockerfile: Dockerfile
context: .
build-args: |
VERSION=PR-${{ github.event.number }}
upload-image:
runs-on: ubuntu-latest
needs: [ build-image ]
steps:
- id: save
run: |
# taking only first image is enough, because 'images' point to single image with multiple tags
src="$(echo '${{ needs.build-image.outputs.images }}' | jq -r '.[0]')"
dest="api-gateway-manager:PR-${{ github.event.number }}"
docker pull "$src"
docker tag "$src" "$dest"
docker save "$dest" > /tmp/manager-image.tar
- id: upload
uses: actions/upload-artifact@v4
with:
path: /tmp/manager-image.tar
name: manager-image
unit-tests:
name: Unit tests & lint
if: github.event.pull_request.draft == false
uses: ./.github/workflows/pull-unit-lint.yaml
secrets: inherit
integration-tests:
name: Integration tests
needs: [ upload-image ]
if: github.event.pull_request.draft == false
uses: ./.github/workflows/pull-integration-release.yaml
secrets: inherit
ui-tests:
name: UI tests
needs: [upload-image]
if: github.event.pull_request.draft == false
uses: ./.github/workflows/ui-tests.yaml
secrets: inherit
verify-pins:
name: Verify-commit-pins
if: github.event.pull_request.draft == false
uses: ./.github/workflows/verify-commit-pins.yaml
secrets: inherit
pull-request-status:
needs: [ build-image, upload-image, unit-tests, integration-tests, ui-tests, verify-pins ]
runs-on: ubuntu-latest
if: always()
steps:
- if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1