-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(release): fixed ci workflow (#72)
* feat(release): fixed ci workflow Signed-off-by: Ujjwal Kumar <Ujjwal.Kumar1@ibm.com> * feat(release): fixed ci workflow Signed-off-by: Ujjwal Kumar <Ujjwal.Kumar1@ibm.com> * feat(release): fixed ci workflow Signed-off-by: Ujjwal Kumar <Ujjwal.Kumar1@ibm.com> * feat(release): fixed ci workflow Signed-off-by: Ujjwal Kumar <Ujjwal.Kumar1@ibm.com> --------- Signed-off-by: Ujjwal Kumar <Ujjwal.Kumar1@ibm.com>
- Loading branch information
1 parent
a5a480b
commit 9065aea
Showing
3 changed files
with
74 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
tags: ['v*'] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
environment: ci | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Install pandoc | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install pandoc | ||
pip install pypandoc | ||
- name: Install npm | ||
run: | | ||
sudo npm install -g npm@latest || sudo npm install -g npm@9 | ||
- name: Install dependencies | ||
run: pip install 'tox<4' tox-gh-actions | ||
|
||
- name: Run tests | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
run: tox | ||
|
||
- name: Install release dependencies | ||
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.8' | ||
run: | | ||
pip install bump-my-version | ||
sudo npm install -g --save-dev \ | ||
@semantic-release/changelog \ | ||
@semantic-release/exec \ | ||
@semantic-release/git \ | ||
@semantic-release/github | ||
- name: Semantic Release | ||
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.8' | ||
run: npx semantic-release | ||
|
||
- name: Publish to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.8' | ||
run: | | ||
pip install build twine | ||
python -m build | ||
python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
[tox] | ||
envlist = py37-lint, py37, py38, py39 | ||
|
||
[gh-actions] | ||
python = | ||
3.7: py37, py37-lint | ||
3.8: py38 | ||
3.9: py39 | ||
|
||
[testenv:py37-lint] | ||
basepython = python3.7 | ||
deps = pylint | ||
commands = pylint --rcfile=.pylintrc ibm-vpc test/unit | ||
|
||
[testenv] | ||
passenv = TOXENV CI TRAVIS* | ||
passenv = TOXENV CI GITHUB_* | ||
commands = | ||
pytest -v test/unit | ||
|
||
deps = | ||
-r{toxinidir}/requirements.txt | ||
-r{toxinidir}/requirements-dev.txt | ||
usedevelop = True | ||
exclude = .venv,.git,.tox,docs | ||
exclude = .venv,.git,.tox,docs |