[pre-commit.ci] pre-commit autoupdate #263
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: Build | |
on: | |
push: | |
branches: [ master, develop ] | |
pull_request: | |
branches: [ master, develop ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ 3.7, 3.8 ] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.5.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: "Install Poetry" | |
uses: Gr1N/setup-poetry@v3 | |
with: | |
poetry-version: 1.0 | |
- name: "Configure Poetry for in-project venvs" | |
run: poetry config virtualenvs.in-project true | |
- name: Set up cache | |
uses: actions/cache@v1 | |
with: | |
path: .venv | |
# key: venv-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
key: venv-${{ matrix.python-version }} | |
- name: Poetry install | |
run: poetry install | |
- name: Show outdated packages | |
run: poetry show --outdated | |
continue-on-error: true | |
- uses: pre-commit/action@v2.0.0 | |
if: ${{ matrix.python-version == '3.8' }} | |
- name: Test with pytest | |
env: | |
API_ID: ${{ secrets.API_ID }} | |
API_HASH: ${{ secrets.API_HASH }} | |
SESSION_STRING: ${{ secrets.SESSION_STRING }} | |
run: poetry run pytest tests/ examples/pytest/ --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=tgintegration --cov-report=xml --cov-report=html | |
if: ${{ matrix.python-version == '3.8' }} | |
- name: Upload pytest test results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pytest-results-${{ matrix.python-version }} | |
path: junit/test-results-${{ matrix.python-version }}.xml | |
if: ${{ always() }} |