Skip to content

Commit 98a6e88

Browse files
filak-sapphanak-sap
authored andcommitted
ci: migrate to GitHub actions
1 parent 0599db2 commit 98a6e88

File tree

4 files changed

+76
-59
lines changed

4 files changed

+76
-59
lines changed

.github/workflows/python-package.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
python-version: ["3.7", "3.8", "3.9", "3.10.1"]
20+
lxml-version: ["4.1.1", "4.2.6", "4.3.5", "4.4.3", "4.5.2", "4.6.5", "4.7.1"]
21+
exclude:
22+
- python-version: 3.9
23+
lxml-version: 4.1.1
24+
- python-version: 3.9
25+
lxml-version: 4.2.6
26+
- python-version: 3.10.1
27+
lxml-version: 4.1.1
28+
- python-version: 3.10.1
29+
lxml-version: 4.2.6
30+
- python-version: 3.10.1
31+
lxml-version: 4.3.5
32+
- python-version: 3.10.1
33+
lxml-version: 4.4.3
34+
- python-version: 3.10.1
35+
lxml-version: 4.5.2
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Install lxml dependencies
41+
run: sudo apt-get install -y libxml2-dev libxslt-dev
42+
43+
- name: Set up Python ${{ matrix.python-version }}
44+
uses: actions/setup-python@v2
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip
51+
python -m pip install lxml==${{ matrix.lxml-version }}
52+
python -m pip install -r dev-requirements.txt
53+
python -m pip install -r requirements.txt
54+
55+
- name: Lint
56+
run: |
57+
make lint
58+
59+
- name: Test
60+
run: |
61+
make test report-coverage
62+
63+
- name: Security
64+
uses: jpetrucciani/bandit-check@master
65+
with:
66+
bandit_flags: '-lll'
67+
68+
- name: Upload Coverage to Codecov
69+
uses: codecov/codecov-action@v1

.travis.yml

-58
This file was deleted.

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ FLAKE8_PARAMS=
2121

2222
COVERAGE_BIN=coverage3
2323
COVERAGE_REPORT_ARGS=--skip-covered
24+
COVERAGE_CMD_REPORT=$(COVERAGE_BIN) report
2425
COVERAGE_CMD_HTML=$(COVERAGE_BIN) html
2526
COVERAGE_HTML_DIR=.htmlcov
2627
COVERAGE_HTML_ARGS=$(COVERAGE_REPORT_ARGS) -d $(COVERAGE_HTML_DIR)
@@ -40,6 +41,11 @@ test:
4041
.coverage: $(COVERAGE_REPORT_FILES) $(TESTS_UNIT_FILES)
4142
$(MAKE) test PYTEST_PARAMS="--cov-report= --cov=$(PYTHON_MODULE)"
4243

44+
.PHONY: report-coverage
45+
report-coverage: .coverage
46+
@ echo "Generating code coverage report ..."
47+
@ $(COVERAGE_CMD_REPORT) $(COVERAGE_REPORT_ARGS) $(COVERAGE_REPORT_FILES)
48+
4349
.PHONY: report-coverage-html
4450
report-coverage-html: .coverage
4551
@ echo "Generating HTML code coverage report ..."

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.com/SAP/python-pyodata.svg?branch=master)](https://travis-ci.com/SAP/python-pyodata)
1+
![Build Status](https://github.com/SAP/python-pyodata/actions/workflows/python-package.yml/badge.svg)
22
[![PyPI version](https://badge.fury.io/py/pyodata.svg)](https://badge.fury.io/py/pyodata)
33
[![codecov](https://codecov.io/gh/SAP/python-pyodata/branch/master/graph/badge.svg)](https://codecov.io/gh/SAP/python-pyodata)
44
[![Total alerts](https://img.shields.io/lgtm/alerts/g/SAP/python-pyodata.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/SAP/python-pyodata/alerts/)

0 commit comments

Comments
 (0)