TGTG API Test #225
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: TGTG API Test | |
on: | |
schedule: | |
- cron: 0 1 * * * | |
env: | |
PYTHON_VERSION: '3.10' | |
POETRY_VERSION: 1.5.1 | |
jobs: | |
test: | |
name: Run Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Setup Poetry | |
run: | | |
pip install --upgrade pip setuptools wheel poetry==${{ env.POETRY_VERSION }} | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
with: | |
path: ./.venv | |
key: venv-test-poetry-${{ env.POETRY_VERSION }}-python-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }}-${{ runner.os }} | |
- name: Install dependencies | |
run: poetry install --without build | |
- name: Run tests | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 10 | |
retry_wait_seconds: 1800 | |
command: | | |
poetry run pytest -v -m tgtg_api | |
echo "::add-mask::${{ env.TGTG_ACCESS_TOKEN }}" | |
echo "::add-mask::${{ env.TGTG_REFRESH_TOKEN }}" | |
echo "::add-mask::${{ env.TGTG_USER_ID }}" | |
echo "::add-mask::${{ env.TGTG_COOKIE }}" | |
echo "TGTG_ACCESS_TOKEN=${{ env.TGTG_ACCESS_TOKEN }}" >> $GITHUB_ENV | |
echo "TGTG_REFRESH_TOKEN=${{ env.TGTG_REFRESH_TOKEN }}" >> $GITHUB_ENV | |
echo "TGTG_USER_ID=${{ env.TGTG_USER_ID }}" >> $GITHUB_ENV | |
echo "TGTG_COOKIE=${{ env.TGTG_COOKIE }}" >> $GITHUB_ENV | |
env: | |
TGTG_USERNAME: ${{ secrets.TGTG_USERNAME }} | |
TGTG_ACCESS_TOKEN: ${{ secrets.TGTG_ACCESS_TOKEN }} | |
TGTG_REFRESH_TOKEN: ${{ secrets.TGTG_REFRESH_TOKEN }} | |
TGTG_USER_ID: ${{ secrets.TGTG_USER_ID }} | |
TGTG_COOKIE: ${{ secrets.TGTG_COOKIE }} | |
- uses: Der-Henning/actions-set-secret@v2.1.0 | |
with: | |
name: TGTG_ACCESS_TOKEN | |
value: ${{ env.TGTG_ACCESS_TOKEN }} | |
repository: ${{ github.repository }} | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
- uses: Der-Henning/actions-set-secret@v2.1.0 | |
with: | |
name: TGTG_REFRESH_TOKEN | |
value: ${{ env.TGTG_REFRESH_TOKEN }} | |
repository: ${{ github.repository }} | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
- uses: Der-Henning/actions-set-secret@v2.1.0 | |
with: | |
name: TGTG_USER_ID | |
value: ${{ env.TGTG_USER_ID }} | |
repository: ${{ github.repository }} | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
- uses: Der-Henning/actions-set-secret@v2.1.0 | |
with: | |
name: TGTG_COOKIE | |
value: ${{ env.TGTG_COOKIE }} | |
repository: ${{ github.repository }} | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} |