-
Notifications
You must be signed in to change notification settings - Fork 61
97 lines (85 loc) · 2.37 KB
/
cicd.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
name: cicd
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
permissions: {}
defaults:
run:
shell: bash
env:
SKIP_INTEGRATION_TESTS: 'none' # 'none', 'non-required', 'all'
jobs:
conditionals:
runs-on: ubuntu-latest
outputs:
skip_integration_tests: ${{ steps.conditionals.outputs.skip_integration_tests }}
steps:
- name: CI conditionals
id: conditionals
run: |
echo "skip_integration_tests=${SKIP_INTEGRATION_TESTS}" >> ${GITHUB_OUTPUT}
build:
uses: ./.github/workflows/.reusable-build.yml
permissions:
packages: write
secrets: inherit
compliance:
uses: ./.github/workflows/.reusable-compliance.yml
permissions:
contents: write
id-token: write
security-events: write
actions: read
checks: read
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
statuses: read
secrets: inherit
sast:
uses: ./.github/workflows/.reusable-sast.yml
permissions:
security-events: write
pull-requests: read
sca:
uses: ./.github/workflows/.reusable-sca.yml
needs: [build]
permissions:
contents: write
security-events: write
packages: read
secrets: inherit
with:
registry: ${{ needs.build.outputs.build_registry }}
repo_owner: ${{ github.repository_owner }}
image: ${{ needs.build.outputs.build_image }}
unit-test:
uses: ./.github/workflows/.reusable-unit-test.yml
docs:
uses: ./.github/workflows/.reusable-docs.yaml
permissions:
contents: write
integration-test:
uses: ./.github/workflows/.reusable-integration-test.yml
needs: [conditionals, build]
if: needs.conditionals.outputs.skip_integration_tests != 'all'
permissions:
packages: read
secrets: inherit
with:
build_registry: ${{ needs.build.outputs.build_registry }}
repo_owner: ${{ github.repository_owner }}
build_image_repository: ${{ needs.build.outputs.build_registry }}/${{ needs.build.outputs.build_repo }}
build_tag: ${{ needs.build.outputs.build_tag }}
skip_integration_tests: ${{ needs.conditionals.outputs.skip_integration_tests }}
cosign_public_key: ${{ needs.build.outputs.cosign_public_key }}