Test #1164
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
| name: Test | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: '0 7 * * *' | |
| workflow_dispatch: | |
| env: | |
| PYTHON_VERSION: 3.11.0 | |
| POETRY_VERSION: 1.3.1 | |
| jobs: | |
| flake8: | |
| if: github.event_name != 'schedule' | |
| name: Flake8 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python: [ "3.11", "3.10", "3.9" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Run pip install | |
| run: python -m pip install 'flake8>=5.0.4' | |
| - name: Style Test | |
| id: test | |
| run: | | |
| python -m flake8 --max-line-length=120 faapi | |
| mypy: | |
| if: github.event_name != 'schedule' | |
| name: mypy | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python: [ "3.11", "3.10", "3.9" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Run pip install | |
| run: python -m pip install 'mypy>=0.991' 'pytest>=7.2.0' 'types-beautifulsoup4>=4.11.6' | |
| - name: Types test | |
| id: test | |
| run: | | |
| python -m mypy --install-types --non-interactive --check-untyped-defs faapi | |
| python -m mypy --install-types --non-interactive --check-untyped-defs tests | |
| pytest: | |
| name: pytest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - uses: abatilo/actions-poetry@v2.0.0 | |
| with: | |
| poetry-version: ${{ env.POETRY_VERSION }} | |
| - run: | | |
| poetry install | |
| - name: Unit test | |
| env: | |
| TEST_DATA: ${{ secrets.TEST_DATA }} | |
| TEST_USER: ${{ secrets.TEST_USER }} | |
| TEST_SUBMISSION: ${{ secrets.TEST_SUBMISSION }} | |
| TEST_JOURNAL: ${{ secrets.TEST_JOURNAL }} | |
| run: | | |
| echo "$TEST_DATA" > tests/test_data.json | |
| echo "$TEST_USER" > tests/test_user.json | |
| echo "$TEST_SUBMISSION" > tests/test_submission.json | |
| echo "$TEST_JOURNAL" > tests/test_journal.json | |
| poetry run coverage run -m pytest tests/test_connection.py tests/test_parse.py tests/test_faapi.py -v --tb=line |