Skip to content

Commit

Permalink
ENG-1255: gitlab actions instead of travis
Browse files Browse the repository at this point in the history
  • Loading branch information
korneevm committed May 20, 2021
1 parent 746fa90 commit a91476e
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 26 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint and test code

on:
push:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -r requirements_dev.txt
- name: Run mdl
uses: actionshub/markdownlint@main
- name: Run checks
run: make style types requirements
- name: Run tests and publish coverage
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: make coverage
26 changes: 26 additions & 0 deletions .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint and test code

on:
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -r requirements_dev.txt
- name: Run mdl
uses: actionshub/markdownlint@main
- name: Run checks
run: make style types requirements
- name: Run tests
run: make test
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Python package

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -r requirements_dev.txt
- name: Run checks
run: make style types requirements test
publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install dependencies
run: pip install -r requirements_dev.txt setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style '.mdlrc.rb'
2 changes: 2 additions & 0 deletions .mdlrc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
all
rule 'MD013', :line_length => 120
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

23 changes: 20 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
check:
flake8 .
mypy .
test:
python -m pytest

coverage:
python -m pytest --cov=flake8_variables_names --cov-report=xml

types:
mypy .

style:
flake8 .

readme:
mdl README.md

requirements:
safety check -r requirements_dev.txt

check:
make style
make types
make test
make requirements
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flake8-variables-names

[![Build Status](https://travis-ci.org/best-doctor/flake8-variables-names.svg?branch=master)](https://travis-ci.org/best-doctor/flake8-variables-names)
[![Build Status](https://github.com/best-doctor/flake8-variables-names/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/best-doctor/flake8-variables-names/actions/workflows/build.yml)
[![Maintainability](https://api.codeclimate.com/v1/badges/c7502e578af3f4437179/maintainability)](https://codeclimate.com/github/best-doctor/flake8-variables-names/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/c7502e578af3f4437179/test_coverage)](https://codeclimate.com/github/best-doctor/flake8-variables-names/test_coverage)
[![PyPI version](https://badge.fury.io/py/flake8-variables-names.svg)](https://badge.fury.io/py/flake8-variables-names)
Expand All @@ -18,7 +18,7 @@ parameter end extend variable names blacklist even more.

## Installation

```bash
```terminal
pip install flake8-variables-names
```

Expand All @@ -36,7 +36,7 @@ result = a + foo

Usage:

```bash
```terminal
$ flake8 test.py
test.py:1:1: VNE001 single letter variable names are not allowed
test.py:2:1: VNE002 variable name should be clarified
Expand All @@ -63,7 +63,7 @@ We would love you to contribute to our project. It's simple:
Here are useful tips:

- You can run all checks and tests with `make check`.
Please do it before TravisCI does.
Please do it before CI does.
- We use [BestDoctor python styleguide](https://github.com/best-doctor/guides/blob/master/guides/en/python_styleguide.md).
- We respect [Django CoC](https://www.djangoproject.com/conduct/).
Make soft, not bullshit.

0 comments on commit a91476e

Please sign in to comment.