diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 4f793b37f..218ea852e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,9 +2,9 @@ name: Run Checks on: push: - branches: ["main"] + branches: [ "main" ] pull_request: - branches: ["main"] + branches: [ "main" ] jobs: test: @@ -14,50 +14,62 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: .venv - key: ${{ runner.os }}-${{ matrix.python }}-dependencies-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.python }}-dependencies - - name: Install dependencies - run: | - pip install poetry - python -m venv .venv - poetry run python -m pip install --upgrade pip - poetry install - - - name: Run Black - run: poetry run black . --check - - - name: Run isort - run: poetry run isort . --check - - - name: Run flake8 - run: poetry run flake8 openapi_python_client - - - name: Run safety - run: poetry export -f requirements.txt | poetry run safety check --bare --stdin - - - name: Run mypy - run: poetry run mypy --show-error-codes openapi_python_client - - - name: Run pylint - run: poetry run pylint openapi_python_client - - - name: Run pytest - run: poetry run pytest --cov=openapi_python_client --cov-report=term-missing tests end_to_end_tests/test_end_to_end.py - - - name: Generate coverage report - shell: bash - run: poetry run coverage xml - - - uses: codecov/codecov-action@v2 - with: - files: ./coverage.xml + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + + - name: Get Python Version + id: get_python_version + run: echo "::set-output name=python_version::$(python --version)" + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: .venv + key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies + - name: Install Poetry + run: pip install poetry + + - name: Create Virtual Environment + run: python -m venv .venv + + - name: Upgrade pip + run: poetry run python -m pip install --upgrade pip + + - name: Install Dependencies + run: poetry install + + - name: Run Black + run: poetry run black . --check + + - name: Run isort + run: poetry run isort . --check + + - name: Run flake8 + run: poetry run flake8 openapi_python_client + + - name: Run safety + run: poetry export -f requirements.txt | poetry run safety check --bare --stdin + + - name: Run mypy + run: poetry run mypy --show-error-codes openapi_python_client + + - name: Run pylint + run: poetry run pylint openapi_python_client + + - name: Run pytest + run: poetry run pytest --cov=openapi_python_client --cov-report=term-missing tests end_to_end_tests/test_end_to_end.py --basetemp=tests/tmp + env: + TASKIPY: true + + - name: Generate coverage report + shell: bash + run: poetry run coverage xml + + - uses: codecov/codecov-action@v2 + with: + files: ./coverage.xml