-
Notifications
You must be signed in to change notification settings - Fork 25
114 lines (103 loc) · 3.61 KB
/
ci.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
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
name: CI
on:
push:
tags:
- 'v*'
- '!v*-RC*'
pull_request:
branches:
- main
- 'release/*'
workflow_dispatch: {}
defaults:
run:
shell: bash
jobs:
envs:
name: Setup environment variables for further tests
if: startsWith(github.ref, 'refs/pull/') || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
outputs:
pr_branch: ${{ steps.get_branch_names.outputs.pr_branch }}
deployment_upgrade_tag: ${{ steps.get_deployment_upgrade_tag.outputs.tag }}
deployment_tag: ${{ steps.get_deployment_tag.outputs.tag }}
steps:
- name: Get branch names and set as outputs
id: get_branch_names
if: startsWith(github.ref, 'refs/pull/')
run: |
echo "pr_branch=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_OUTPUT
- name: Get created deployment tag and set as output
id: get_deployment_upgrade_tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "tag=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
- name: Get previous deployment tag
id: get_deployment_tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "tag=$(git tag | grep -v RC | tail -2 | head -1)" >> $GITHUB_OUTPUT
trigger-docker-compose-testing:
if: startsWith(github.ref, 'refs/pull/')
runs-on: ubuntu-latest
needs: envs
steps:
- name: Checkout actions repo
uses: actions/checkout@v4
with:
repository: Telecominfraproject/.github
path: github
- name: Trigger testing of OpenWifi Docker Compose deployment and wait for result
uses: ./github/composite-actions/trigger-workflow-and-wait
env:
PR_BRANCH: ${{ needs.envs.outputs.pr_branch }}
with:
owner: Telecominfraproject
repo: wlan-testing
workflow: ow_docker-compose.yml
token: ${{ secrets.WLAN_TESTING_PAT }}
ref: master
inputs: '{"deployment_version": "${{ env.PR_BRANCH }}", "microservice": "all"}'
trigger-k8s-testing:
if: startsWith(github.ref, 'refs/pull/')
runs-on: ubuntu-latest
needs: envs
steps:
- name: Checkout actions repo
uses: actions/checkout@v4
with:
repository: Telecominfraproject/.github
path: github
- name: Trigger testing of OpenWifi Docker Compose deployment and wait for result
uses: ./github/composite-actions/trigger-workflow-and-wait
env:
PR_BRANCH: ${{ needs.envs.outputs.pr_branch }}
with:
owner: Telecominfraproject
repo: wlan-testing
workflow: ow_k8s.yml
token: ${{ secrets.WLAN_TESTING_PAT }}
ref: master
inputs: '{"deployment_version": "${{ env.PR_BRANCH }}", "microservice": "all"}'
trigger-docker-compose-upgrade-testing:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: envs
steps:
- name: Checkout actions repo
uses: actions/checkout@v4
with:
repository: Telecominfraproject/.github
path: github
- name: Trigger testing of OpenWifi Docker Compose deployment upgrade and wait for result
uses: ./github/composite-actions/trigger-workflow-and-wait
env:
DEPLOYMENT_TAG: ${{ needs.envs.outputs.deployment_tag }}
DEPLOYMENT_UPGRADE_TAG: ${{ needs.envs.outputs.deployment_upgrade_tag }}
with:
owner: Telecominfraproject
repo: wlan-testing
workflow: ow_docker-compose-upgrade-test.yml
token: ${{ secrets.WLAN_TESTING_PAT }}
ref: master
inputs: '{"deployment_version": "${{ env.DEPLOYMENT_TAG }}", "deployment_upgrade_version": "${{ env.DEPLOYMENT_UPGRADE_TAG }}"}'