https://telecominfraproject.atlassian.net/browse/WIFI-13246 #172
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
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@v3 | |
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@v3 | |
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 }}"}' |