Skip to content

Commit a91476e

Browse files
committed
ENG-1255: gitlab actions instead of travis
1 parent 746fa90 commit a91476e

File tree

8 files changed

+123
-26
lines changed

8 files changed

+123
-26
lines changed

.github/workflows/build.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint and test code
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8, 3.9]
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: pip install -r requirements_dev.txt
21+
- name: Run mdl
22+
uses: actionshub/markdownlint@main
23+
- name: Run checks
24+
run: make style types requirements
25+
- name: Run tests and publish coverage
26+
uses: paambaati/[email protected]
27+
env:
28+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
29+
with:
30+
coverageCommand: make coverage

.github/workflows/build_pr.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint and test code
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8, 3.9]
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: pip install -r requirements_dev.txt
21+
- name: Run mdl
22+
uses: actionshub/markdownlint@main
23+
- name: Run checks
24+
run: make style types requirements
25+
- name: Run tests
26+
run: make test

.github/workflows/publish.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Python package
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: [3.6, 3.7, 3.8, 3.9]
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: pip install -r requirements_dev.txt
22+
- name: Run checks
23+
run: make style types requirements test
24+
publish:
25+
runs-on: ubuntu-latest
26+
needs: build
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v2
31+
- name: Install dependencies
32+
run: pip install -r requirements_dev.txt setuptools wheel twine
33+
- name: Build and publish
34+
env:
35+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
36+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
37+
run: |
38+
python setup.py sdist bdist_wheel
39+
twine upload dist/*
40+

.mdlrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style '.mdlrc.rb'

.mdlrc.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
all
2+
rule 'MD013', :line_length => 120

.travis.yml

-19
This file was deleted.

Makefile

+20-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
check:
2-
flake8 .
3-
mypy .
1+
test:
2+
python -m pytest
3+
4+
coverage:
45
python -m pytest --cov=flake8_variables_names --cov-report=xml
6+
7+
types:
8+
mypy .
9+
10+
style:
11+
flake8 .
12+
13+
readme:
514
mdl README.md
15+
16+
requirements:
617
safety check -r requirements_dev.txt
18+
19+
check:
20+
make style
21+
make types
22+
make test
23+
make requirements

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# flake8-variables-names
22

3-
[![Build Status](https://travis-ci.org/best-doctor/flake8-variables-names.svg?branch=master)](https://travis-ci.org/best-doctor/flake8-variables-names)
3+
[![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)
44
[![Maintainability](https://api.codeclimate.com/v1/badges/c7502e578af3f4437179/maintainability)](https://codeclimate.com/github/best-doctor/flake8-variables-names/maintainability)
55
[![Test Coverage](https://api.codeclimate.com/v1/badges/c7502e578af3f4437179/test_coverage)](https://codeclimate.com/github/best-doctor/flake8-variables-names/test_coverage)
66
[![PyPI version](https://badge.fury.io/py/flake8-variables-names.svg)](https://badge.fury.io/py/flake8-variables-names)
@@ -18,7 +18,7 @@ parameter end extend variable names blacklist even more.
1818

1919
## Installation
2020

21-
```bash
21+
```terminal
2222
pip install flake8-variables-names
2323
```
2424

@@ -36,7 +36,7 @@ result = a + foo
3636

3737
Usage:
3838

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

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

0 commit comments

Comments
 (0)