Skip to content

Commit 39cc248

Browse files
authored
fix(switch_to_actions): Switching to actions.
* Update python-package.yml * Update python-package.yml * Update python-package.yml * fix(build_issues): Adding deploy Precommit-Verified: a2d8d003e86b8c51ae3db0b9942845244d07daa43d2758eb3004ec09cd1b2a59
1 parent cd6baea commit 39cc248

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

.github/workflows/python-package.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ on:
1010
branches: [ main ]
1111

1212
jobs:
13-
deploy:
13+
build:
1414
runs-on: ubuntu-latest
1515

1616
strategy:
1717
matrix:
18-
python-version: [3.7, 3.8, 3.9]
18+
python-version: [3.7]
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -26,14 +26,35 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
python -m pip install flake8 pytest
30-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
pip install -e . -r requirements.txt -r requirements-tests.txt python-semantic-release
30+
sudo apt-get update && sudo apt-get install -y nodejs npm && sudo npm install -g dockerfilelint
3131
- name: Lint with flake8
3232
run: |
3333
# stop the build if there are Python syntax errors or undefined names
34-
flake8 vmware_exporter tests --count --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 vmware_exporter tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
flake8 vmware_exporter tests --statistics
35+
- name: Lint dockerfile
36+
run: dockerfilelint ./Dockerfile
3737
- name: Test with pytest
3838
run: |
3939
pytest --cov=. -v tests/unit
40+
- uses: codecov/codecov-action@v1
41+
- name: integration tests
42+
run: |
43+
pytest tests/integration
44+
45+
deploy:
46+
needs: ["build"]
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: deploy pip
51+
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
52+
run: |
53+
git config --global user.name "semantic-release (via github actions)"
54+
git config --global user.email "semantic-release@github-actions"
55+
semantic-release publish
56+
semantic-release changelog --post
57+
env: # Or as an environment variable
58+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
59+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
60+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

requirements-tests.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ pytest==5.4.1
33
pytest-cov==2.8.1
44
pytest-twisted==1.12
55
codecov==2.0.17
6-
flake8==3.6.0
6+
flake8>=3.6.0
7+
pyflakes>=1.5.0

0 commit comments

Comments
 (0)