Testops Report DAILY - Production #165
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: Testops Report DAILY - Production | |
# Daily @8am UTC | |
on: | |
schedule: | |
- cron: "0 8 * * *" | |
workflow_dispatch: | |
inputs: | |
branchName: | |
description: 'Default branch' | |
required: true | |
default: 'master' | |
jobs: | |
deploy: | |
name: Jira and Bugzilla TestOps Report (DAILY) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out source repository | |
uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v1 | |
- name: Establish Cloud SQL Proxy | |
uses: mattes/gce-cloudsql-proxy-action@v1 | |
with: | |
creds: ${{ secrets.GCLOUD_AUTH }} | |
instance: ${{ secrets.CLOUD_SQL_CONNECTION_NAME }} | |
port: ${{ secrets.CLOUD_SQL_DATABASE_PORT }} | |
- name: Install requirements | |
run: | | |
pip install -r requirements.txt | |
- name: Set env vars | |
run: | | |
echo "CLOUD_SQL_DATABASE_USERNAME=${{ secrets.CLOUD_SQL_DATABASE_USERNAME }}" >> $GITHUB_ENV | |
echo "CLOUD_SQL_DATABASE_PASSWORD=${{ secrets.CLOUD_SQL_DATABASE_PASSWORD }}" >> $GITHUB_ENV | |
echo "CLOUD_SQL_DATABASE_NAME=production" >> $GITHUB_ENV | |
echo "CLOUD_SQL_DATABASE_PORT=${{ secrets.CLOUD_SQL_DATABASE_PORT }}" >> $GITHUB_ENV | |
echo "TESTRAIL_HOST=${{ secrets.TESTRAIL_HOST }}" >> $GITHUB_ENV | |
echo "TESTRAIL_USERNAME=${{ secrets.TESTRAIL_USERNAME }}" >> $GITHUB_ENV | |
echo "TESTRAIL_PASSWORD=${{ secrets.TESTRAIL_PASSWORD }}" >> $GITHUB_ENV | |
echo "JIRA_HOST=${{ secrets.JIRA_HOST }}" >> $GITHUB_ENV | |
echo "JIRA_USER=${{ secrets.JIRA_USER }}" >> $GITHUB_ENV | |
echo "JIRA_PASSWORD=${{ secrets.JIRA_PASSWORD }}" >> $GITHUB_ENV | |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
echo "BUGZILLA_API_KEY=${{ secrets.BUGZILLA_API_KEY }}" >> $GITHUB_ENV | |
- name: Jira query | |
run: python ./__main__.py --report-type jira-qa-requests | |
- name: Jira query | |
if: always() | |
run: python ./__main__.py --report-type jira-qa-needed | |
- name: Bugzilla query | |
if: always() | |
run: python ./__main__.py --report-type bugzilla-qe-verify | |
- name: Set job log URL | |
if: always() | |
run: echo "JOB_LOG_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV | |
- name: Send custom JSON data to Slack workflow | |
if: always() | |
id: slack | |
uses: slackapi/slack-github-action@v1.26.0 | |
env: | |
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }} | |
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_MOBILE_ALERTS_TOOLING }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
with: | |
payload-file-path: "./payload-slack-content.json" |