-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from pyupio/develop
Safety 2.2.0 patch
- Loading branch information
Showing
15 changed files
with
261 additions
and
241 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
name: Safety Action Build And Publish | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: [master] | ||
|
||
env: | ||
DOCKER_BUILDKIT: 1 | ||
|
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,117 @@ | ||
name: Python package | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r test_requirements.txt | ||
- name: Test with pytest | ||
run: | | ||
pytest -rP tests/ --cov=dparse/ --cov-report=xml --cov-report=html | ||
build-binaries: | ||
needs: test | ||
runs-on: ${{ matrix.os }} | ||
|
||
if: contains(fromJson('["refs/heads/master", "refs/heads/develop", "refs/heads/binaries-fixes"]'), github.ref) || startsWith(github.ref, 'refs/tags') | ||
|
||
strategy: | ||
matrix: | ||
os: ['windows-latest', 'ubuntu-latest', 'macos-latest'] | ||
env: | ||
BINARY_OS: '${{ matrix.os }}' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Install Dependencies | ||
run: python binaries.py install | ||
- name: Test Safety | ||
run: python binaries.py test | ||
- name: Producing Binaries | ||
run: python binaries.py dist | ||
- uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
with: | ||
name: safety-win-i686.exe | ||
path: dist/safety-win-i686.exe | ||
if-no-files-found: error | ||
- uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
with: | ||
name: safety-win-x86_64.exe | ||
path: dist/safety-win-x86_64.exe | ||
if-no-files-found: error | ||
- uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
with: | ||
name: safety-linux-i686 | ||
path: dist/safety-linux-i686 | ||
if-no-files-found: error | ||
- uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
with: | ||
name: safety-linux-x86_64 | ||
path: dist/safety-linux-x86_64 | ||
if-no-files-found: error | ||
- uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
with: | ||
name: safety-macos-x86_64 | ||
path: dist/safety-macos-x86_64 | ||
if-no-files-found: error | ||
|
||
|
||
deploy-pypi: | ||
needs: build-binaries | ||
runs-on: ubuntu-latest | ||
|
||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.SAFETY_PYPI_API_TOKEN }} | ||
|
||
create-gh-release: | ||
needs: deploy-pypi | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "dist/safety-win-i686.exe,dist/safety-win-x86_64.exe,dist/safety-linux-i686,dist/safety-linux-x86_64,dist/safety-macos-x86_64" | ||
token: ${{ secrets.SAFETY_GITHUB_TOKEN }} |
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
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
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
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
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 +1 @@ | ||
2.1.1 | ||
2.2.0.dev |
Oops, something went wrong.