From 4102210ed0f4fe26274aba648391d8c5440ddfce Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Sun, 30 Jan 2022 11:43:11 +0100 Subject: [PATCH] add ci --- .github/workflows/ci.yml | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e8720af --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + branches: + - next + pull_request: + branches: + - next + +env: + DEFAULT_PYTHON: 3.7 + +jobs: + code-quality: + runs-on: "ubuntu-latest" + name: Check code quality + steps: + - uses: "actions/checkout@v2" + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v2.3.1 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + cache: "pip" + cache-dependency-path: "requirements*" + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install -r requirements-test.txt + # Following steps cannot run by pre-commit.ci as repo = local + - name: Run mypy + run: mypy bumper/ + - name: Pylint review + run: pylint bumper/ + + tests: + runs-on: "ubuntu-latest" + name: Run tests + steps: + - uses: "actions/checkout@v2" + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v2.3.1 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + cache: "pip" + cache-dependency-path: "requirements*" + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install -r requirements-test.txt + - name: Run pytest + run: pytest --cov=./ --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true