-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add daily task to query TestRail and populate DDBB (#37)
- Loading branch information
1 parent
8444a44
commit ce8ad4c
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Testops Report DAILY | ||
|
||
# Daily @8am UTC | ||
on: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
branchName: | ||
description: 'Default branch' | ||
required: true | ||
default: 'master' | ||
|
||
jobs: | ||
deploy: | ||
name: Jira 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 "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $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: 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/[email protected] | ||
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 }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
with: | ||
payload-file-path: "./payload-slack-content.json" |