PLaying around with github secrents and connections. #1
This file contains hidden or 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
| # .github/workflows/ci.yml (excerpt) | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install deps | |
| run: pip install -r requirements.txt | |
| - name: Expose Google-Drive secrets | |
| run: | | |
| # 1) materialise the JSON file | |
| echo "${{ secrets.GDRIVE_SERVICE_ACCOUNT_JSON }}" > $HOME/gdrive.json | |
| # 2) make both paths available to the test process | |
| echo "GDRIVE_SERVICE_ACCOUNT_FILE=$HOME/gdrive.json" >> $GITHUB_ENV | |
| echo "GDRIVE_ROOT_FOLDER_ID=${{ secrets.GDRIVE_ROOT_FOLDER_ID }}" >> $GITHUB_ENV | |
| - name: Run pytest | |
| env: | |
| CI: "true" # so your skip-marker sees CI=true | |
| run: pytest -q -k test_gdrive_connection |