Skip to content

Commit 9065aea

Browse files
authored
feat(release): fixed ci workflow (#72)
* feat(release): fixed ci workflow Signed-off-by: Ujjwal Kumar <[email protected]> * feat(release): fixed ci workflow Signed-off-by: Ujjwal Kumar <[email protected]> * feat(release): fixed ci workflow Signed-off-by: Ujjwal Kumar <[email protected]> * feat(release): fixed ci workflow Signed-off-by: Ujjwal Kumar <[email protected]> --------- Signed-off-by: Ujjwal Kumar <[email protected]>
1 parent a5a480b commit 9065aea

File tree

3 files changed

+74
-53
lines changed

3 files changed

+74
-53
lines changed

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [master]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
environment: ci
14+
strategy:
15+
matrix:
16+
python-version: ['3.8', '3.9', '3.10', '3.11']
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: 'pip'
28+
29+
- name: Install pandoc
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install pandoc
33+
pip install pypandoc
34+
35+
- name: Install npm
36+
run: |
37+
sudo npm install -g npm@latest || sudo npm install -g npm@9
38+
39+
- name: Install dependencies
40+
run: pip install 'tox<4' tox-gh-actions
41+
42+
- name: Run tests
43+
env:
44+
PYTHON_VERSION: ${{ matrix.python-version }}
45+
run: tox
46+
47+
- name: Install release dependencies
48+
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.8'
49+
run: |
50+
pip install bump-my-version
51+
sudo npm install -g --save-dev \
52+
@semantic-release/changelog \
53+
@semantic-release/exec \
54+
@semantic-release/git \
55+
@semantic-release/github
56+
57+
- name: Semantic Release
58+
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.8'
59+
run: npx semantic-release
60+
61+
- name: Publish to PyPI
62+
if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.8'
63+
run: |
64+
pip install build twine
65+
python -m build
66+
python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}

.travis.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

tox.ini

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
[tox]
22
envlist = py37-lint, py37, py38, py39
33

4+
[gh-actions]
5+
python =
6+
3.7: py37, py37-lint
7+
3.8: py38
8+
3.9: py39
9+
410
[testenv:py37-lint]
511
basepython = python3.7
612
deps = pylint
713
commands = pylint --rcfile=.pylintrc ibm-vpc test/unit
814

915
[testenv]
10-
passenv = TOXENV CI TRAVIS*
16+
passenv = TOXENV CI GITHUB_*
1117
commands =
1218
pytest -v test/unit
1319

1420
deps =
1521
-r{toxinidir}/requirements.txt
1622
-r{toxinidir}/requirements-dev.txt
1723
usedevelop = True
18-
exclude = .venv,.git,.tox,docs
24+
exclude = .venv,.git,.tox,docs

0 commit comments

Comments
 (0)