TestRail Backup #18
Workflow file for this run
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: TestRail Backup | |
on: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Backup test suites | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backup-tools | |
env: | |
TESTRAIL_HOST: ${{ secrets.TESTRAIL_HOST }} | |
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }} | |
TESTRAIL_PASSWORD: ${{ secrets.TESTRAIL_PASSWORD }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEST_ALERTS_SANDBOX }} | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Establish Google Cloud connection | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCLOUD_AUTH }} | |
- name: Fetch test cases | |
run: | | |
python backup_testrail.py | |
today=`date "+%Y-%m-%d"` | |
mkdir $today | |
cp *.csv $today | |
pwd | |
ls $today | |
echo "today=$today" >> $GITHUB_ENV | |
- name: Upload CSV to GCP bucket | |
uses: google-github-actions/upload-cloud-storage@v2 | |
with: | |
path: backup-tools/${{ env.today }} | |
destination: backups-testrail-test-suites |