-
Notifications
You must be signed in to change notification settings - Fork 7
Adding GitHub Actions workflow config file #154
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
KNanda552
merged 10 commits into
main
from
ICNMLSALESSERVICESWDF2-3549-Move-DAR-SDK-from-Travis-CI-to-Github-actions
Feb 25, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8f44e6f
ICNMLSALESSERVICESWDF2-3549-Move-DAR-SDK-from-Travis-CI-to-Github-ac…
f1888d1
Renaming the token
840459b
Renaming token for system-tests
e382f03
Merge branch 'main' into ICNMLSALESSERVICESWDF2-3549-Move-DAR-SDK-fro…
KNanda552 32c4500
Adding command for upgrading coverage pytest-cov
13fc020
Merge branch 'main' into ICNMLSALESSERVICESWDF2-3549-Move-DAR-SDK-fro…
KNanda552 bcd615b
Improving the workfile
1148f3d
Removing typo
78a7c19
Removing travis.yml
504d652
Removing python patch version
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,126 @@ | ||
| name: CI Workflow | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - rel/** | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Linting | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10.14' | ||
|
|
||
| - name: Install dev dependencies | ||
| run: pip install -r requirements-dev.txt | ||
|
|
||
| - name: Run pre-commit linting | ||
| run: pre-commit run --all-files | ||
|
|
||
| system-tests: | ||
| name: System Tests | ||
| runs-on: windows-latest | ||
| needs: [tests,lint] | ||
| if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/rel/')) | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install test dependencies | ||
| run: pip install -r requirements-test.txt | ||
|
|
||
| - name: Run system tests with tox | ||
| run: tox -e system_tests | ||
| env: | ||
| DAR_CLIENT_ID: ${{ secrets.DAR_CLIENT_ID }} | ||
| DAR_CLIENT_SECRET: ${{ secrets.DAR_CLIENT_SECRET }} | ||
| DAR_AUTH_URL: ${{ secrets.DAR_AUTH_URL }} | ||
| DAR_URL: ${{ secrets.DAR_URL }} | ||
|
|
||
| - name: Create Github Release for Tag | ||
| if: startsWith(github.ref, 'refs/tags/rel/') | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| body: "Tagging release ${{ github.ref }}" | ||
| files: system_test_results/traceability.html | ||
|
|
||
| tests: | ||
| name: Tests on Linux, Windows and macOS environments | ||
| runs-on: ${{ matrix.os}} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - python-version: '3.10' | ||
| toxenv: 'py310-cov' | ||
| os: ubuntu-latest | ||
| - python-version: '3.11' | ||
| toxenv: 'py311-cov' | ||
| os: ubuntu-latest | ||
| - python-version: 'pypy3.10' | ||
| toxenv: 'pypy3-cov' | ||
| os: ubuntu-latest | ||
| - python-version: '3.10' | ||
| toxenv: 'py310-cov' | ||
| os: windows-latest | ||
| - python-version: '3.10' | ||
| toxenv: 'py310-cov' | ||
| os: macos-13 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install test dependencies | ||
| run: pip install -r requirements-test.txt | ||
|
|
||
| - name: Run tests with tox | ||
| run: tox -e ${{ matrix.toxenv }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| deploy: | ||
| name: Deploy to PyPI | ||
| runs-on: ubuntu-latest | ||
| needs: [system-tests] | ||
| if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/rel/') | ||
| permissions: | ||
| contents: read | ||
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Build distributions | ||
| run: pipx run build --sdist --wheel | ||
|
|
||
| - name: Deploy release to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 # Uses OIDC/Workload identities and doesn't require a token | ||
This file was deleted.
Oops, something went wrong.
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
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
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.
Just to be sure, did you make sure to add the trusted publisher configuration in Pypi?
(https://docs.pypi.org/trusted-publishers/adding-a-publisher/)