-
Notifications
You must be signed in to change notification settings - Fork 586
100 lines (93 loc) · 3.36 KB
/
dco_test.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
name: DCO test
on:
pull_request:
types: [opened, reopened, synchronize, unlabeled]
branches:
- master
- main
env:
OPP_DEBUG: 1
OPP_CONTAINER_OPT: "-t"
OPP_SCRIPT_ENV_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-env.sh"
OPP_IMAGE: "quay.io/operator_testing/operator-test-playbooks:latest"
OPP_ANSIBLE_PULL_REPO: "https://github.com/redhat-openshift-ecosystem/operator-test-playbooks"
OPP_ANSIBLE_PULL_BRANCH: "upstream-community"
OPP_THIS_REPO_BASE: "https://github.com"
OPP_THIS_REPO: "k8s-operatorhub/community-operators"
OPP_THIS_BRANCH: "main"
OPP_PROD: 0
OPP_DRY_RUN: 0
KIND_KUBE_VERSION: "v1.27.2"
OPP_PRODUCTION_TYPE: "k8s"
OPP_REVIEWERS_ENABLED: 1
jobs:
pr-check:
if: (!contains(github.event.pull_request.labels.*.name, 'do-not-merge/hold'))
name: "PR-traffic-light"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- id: files
uses: masesgroup/retrieve-changed-files@v2
continue-on-error: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip yq
- name: Operator traffic light
id: op-traffic-light
env:
OPP_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}"
OPP_MODIFIED_FILES: "${{ steps.files.outputs.modified }}"
OPP_ADDED_MODIFIED_FILES: "${{ steps.files.outputs.added_modified }}"
OPP_RENAMED_FILES: "${{ steps.files.outputs.renamed }}"
OPP_REMOVED_FILES: "${{ steps.files.outputs.removed }}"
run: |
echo "Using script '$OPP_SCRIPT_ENV_URL' ..."
echo "global labels $OPP_LABELS"
bash <(curl -sL $OPP_SCRIPT_ENV_URL) || true
outputs:
opp_test_ready: "${{ steps.op-traffic-light.outputs.opp_test_ready }}"
opp_release_ready: "${{ steps.op-traffic-light.outputs.opp_release_ready }}"
opp_stream: "${{ steps.op-traffic-light.outputs.opp_stream }}"
opp_name: "${{ steps.op-traffic-light.outputs.opp_name }}"
opp_version: "${{ steps.op-traffic-light.outputs.opp_version }}"
opp_ci_yaml_only: "${{ steps.op-traffic-light.outputs.opp_ci_yaml_only }}"
opp_op_delete: "${{ steps.op-traffic-light.outputs.opp_op_delete }}"
test-dco:
name: "DCO test (commits signoff)"
needs: pr-check
runs-on: ubuntu-latest
steps:
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: DCO Check
uses: tim-actions/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
commits: ${{ steps.get-pr-commits.outputs.commits }}
test-summary:
name: "Summary"
needs: [ pr-check, test-dco]
if: always()
runs-on: ubuntu-latest
steps:
- name: PR
if: needs.pr-check.outputs.opp_test_ready == '1'
continue-on-error: true
run: |
echo "OP_PR=${{ github.event.pull_request.number }}"
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/