-
Notifications
You must be signed in to change notification settings - Fork 101
feat: Test coverage and automate publish #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
df2311b
feat: Test coverage and automate publish
ankitdas13 713b2cc
Update ci.yml
ankitdas13 f41bab9
Update setup.py
ankitdas13 dbf2c6a
Update ci.yml
ankitdas13 805ebdc
Update ci.yml
ankitdas13 23b9c86
Update ci.yml
ankitdas13 76d4b00
Update ci.yml
ankitdas13 9021f93
Update ci.yml
ankitdas13 7beb9f1
Update ci.yml
ankitdas13 a980e25
Update ci.yml
ankitdas13 69a6035
Update ci.yml
ankitdas13 3d6f157
Update ci.yml
ankitdas13 132a401
Update ci.yml
ankitdas13 d9f3667
Update ci.yml
ankitdas13 5975254
Update setup.py
ankitdas13 63cd16e
Update ci.yml
ankitdas13 871f576
Update ci.yml
ankitdas13 3d195d1
Update ci.yml
ankitdas13 1adb7a8
Update ci.yml
ankitdas13 2c1e61e
add publish job
ankitdas13 28be780
Update ci.yml
ankitdas13 20db8d7
Update ci.yml
ankitdas13 95e9e64
Update ci.yml
ankitdas13 479c618
Update ci.yml
ankitdas13 5cbf553
Update ci.yml
ankitdas13 5246297
Update ci.yml
ankitdas13 09eb13e
Update ci.yml
ankitdas13 18ce0c2
Update ci.yml
ankitdas13 19e2f59
Update ci.yml
ankitdas13 5810786
Update ci.yml
ankitdas13 0aad5d0
Update ci.yml
ankitdas13 748894d
Update ci.yml
ankitdas13 cd4137a
Update ci.yml
ankitdas13 d7ab432
Update ci.yml
ankitdas13 9b97553
Python 3.10 workflow test
ankitdas13 72f301b
Update ci.yml
ankitdas13 1e3357d
remove testpypi
ankitdas13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,81 @@ | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| tags: | ||
| - v[0-9]+.[0-9]+.[0-9]+* | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Python 3 | ||
| uses: actions/setup-python@v3 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build | ||
| python -m build | ||
| python -m pip install --upgrade twine | ||
| python -m twine check dist/* | ||
|
|
||
| - name: 'Upload Artifact' | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
| test: | ||
| name: Test Coverage | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Python 3 | ||
| uses: actions/setup-python@v3 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install responses | ||
| pip install coverage | ||
| python ${{ github.workspace }}/setup.py install | ||
| - name: Run Tests | ||
| run: | | ||
| python -m coverage run -m unittest | ||
| python -m coverage xml | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v3 | ||
|
|
||
| publish: | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Download all workflow run artifacts | ||
| uses: actions/download-artifact@v2 | ||
| with: | ||
| name: dist | ||
| path: dist | ||
| - name: Set up Python 3 | ||
| uses: actions/setup-python@v3 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Publish packages to PyPi | ||
| run: | | ||
| python -m pip install --upgrade twine | ||
| set -ex | ||
| export VERSION=$(python3 setup.py --version) | ||
| python -m twine upload --verbose dist/razorpay-$VERSION-py3-none-any.whl dist/razorpay-$VERSION.tar.gz | ||
| env: | ||
| TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
| TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is twine used for.
And we don't need gpg keys here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need twin for publish the sdk and we dont need gpg key here. Also for testing, I tried to publish our repo in test.pypi ( development repository ) and it dont ask any gpg key.
Check this job this once
https://github.com/razorpay/razorpay-python/actions/runs/4751988677/jobs/8441800971