Threads.net Test #10
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: Threads.net Test | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 14 * * MON' | |
env: | |
PROJECT_DIR: threads-scraper | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
test: [test_thread_scraping, test_user_scraping] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Cache Poetry virtual environment | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/${{ env.PROJECT_DIR }}/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Install dependencies | |
run: | | |
cd ${{ env.PROJECT_DIR }} | |
poetry install | |
- name: Run test | |
env: | |
SCRAPFLY_KEY: ${{ secrets.SCRAPFLY_KEY }} | |
run: | | |
cd ${{ env.PROJECT_DIR }} | |
poetry run pytest test.py -k ${{ matrix.test }} |