Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Latest commit

 

History

History
83 lines (70 loc) · 1.99 KB

README.md

File metadata and controls

83 lines (70 loc) · 1.99 KB

DepHell GitHub Action

An official GitHub Action to run DepHell commands.

Input variables:

  • dephell-env -- DepHell environment to run. Default: job name
  • python-version -- Python version to use when creating venv. Default: python3
  • dephell-version -- DepHell version to install. Default: the latest release.

Example

DepHell config (pyproject.toml):

[tool.dephell.pytest]
from = {format = "pip", path = "requirements.txt"}
command = "pytest"

[tool.dephell.flake8]
from = {format = "pip", path = "requirements-flake.txt"}
python = ">=3.6"
command = "flake8"

[tool.dephell.typing]
from = {format = "poetry", path = "pyproject.toml"}
command = "mypy project_name"

GitHub Actions workflow (.github/workflows/main.yml):

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  # env name detected from the job name, python version explicitly enumerated
  pytest:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version:
          - "3.6"
          - "3.7"
          - "3.8"
          - pypy3
    steps:
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Checkout
        uses: actions/checkout@v2
      - name: Run DepHell
        uses: dephell/dephell_action@master

  # env name enumerated, python version is 3.7
  linters:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        dephell-env:
          - flake8
          - typing
    steps:
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: "3.7"
      - name: Checkout
        uses: actions/checkout@v2
      - name: Run DepHell
        uses: dephell/dephell_action@master
        with:
          dephell-env: ${{ matrix.dephell-env }}

See DepHell documentation for details on configuring DepHell.