Oops python syntax #80
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 PUSH | |
on: | |
push: | |
branches: | |
- clare-experiment-1 | |
jobs: | |
deploy: | |
name: Update testops DB | |
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=staging" >> $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: Get TestRail test suites and tests | |
run: | | |
ls | |
pwd | |
python testrail.py | |
ls *.txt | |
# Use Github Actions marketplace | |
- name: Sign in to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCLOUD_AUTH }} | |
# Set up Cloud SDK | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
# Connect to GCP bucket | |
# gcloud auth activate-service-account test-dashboard-cloud-run@moz-mobile-tools.iam.gserviceaccount.com --key-file=/tmp/gce-cloudsql-proxy/key.json --project=moz-mobile-tools | |
# echo "Hello World!" >> `date +"hello-%Y-%m-%dT%H:%M:%S.txt"` | |
# gcloud storage cp hello-*.txt gs://backups-testrail-test-suites | |
- name: Upload file to GCP bucket | |
uses: google-github-actions/upload-cloud-storage@v2 | |
with: | |
path: '.' | |
glob: ./testrail-backup-*.json | |
destination: backups-testrail-test-suites/ | |