-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ci_osx action * Add ci_ubuntu action * Remove Travis and AppVeyor Both are now replaced with Github Actions. Although Travis and AppVeyor were working fine, the main reason to do this is because with Github Actions the continuous integration can be run without creating a Pull Request. * Add plyer_deploy action * Add GitHub Actions Badges to README * Add ci_windows action * Add ci_ubuntu.sh * Add ci_osx.sh * Add ci_windows.ps1 * Remove Style from ci_osx and ci_windows Style is needed only once (in this case, in ci_ubuntu) * Remove `twine` from `devrequirements` `twine` is used in the `plyer_deploy` action and is installed using `deployment_dependencies`, located in `ci_ubuntu.sh` * Add style_dependencies in ci_ubuntu.sh This because `style` will run in a separate job, so just the needed dependencies are installed in there. * Create a job for `style` only Considering that `style` only needs to run using a single Python version and uses less dependencies, having it as a separate job should finish faster and let the user know quicker if any linter warning appears. * Rename `build` job to `tests` * Check style with flake8 * Create artifacts in plyer_deploy * Create a draft release in plyer_deploy * Add upload coverage step * Build the package before creating the artifacts * Generalize the Python version used in plyer_deploy * Run tests job with Python 3.x instead of using matrix In order to avoid the `Upload Coverage` step to run in three different Python version, the `tests` job now runs with Python 3.x, just like in Kivy. To keep consistency, this change is also applied in `ci_osx` and `ci_windows`.
- Loading branch information
Francisco
authored
Mar 26, 2020
1 parent
63b8192
commit bdaaa87
Showing
11 changed files
with
280 additions
and
90 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,25 @@ | ||
name: Continuous Integration with OSX | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
|
||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: | | ||
source ci/ci_osx.sh | ||
dependencies | ||
- name: Tests | ||
run: | | ||
source ci/ci_osx.sh | ||
tests |
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,55 @@ | ||
name: Continuous Integration with Ubuntu | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
style: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install Dependencies | ||
run: | | ||
source ci/ci_ubuntu.sh | ||
style_dependencies | ||
- name: Style | ||
run: | | ||
source ci/ci_ubuntu.sh | ||
style | ||
tests: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: | | ||
source ci/ci_ubuntu.sh | ||
dependencies | ||
- name: Tests | ||
run: | | ||
source ci/ci_ubuntu.sh | ||
tests | ||
- name: Upload Coverage | ||
if: github.event_name == 'push' && github.ref == 'refs/head/master' | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
run: | | ||
source ci/ci_ubuntu.sh | ||
upload_coverage |
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,25 @@ | ||
name: Continuous Integration with Windows | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: | | ||
. .\ci\ci_windows.ps1 | ||
Dependencies | ||
- name: Tests | ||
run: | | ||
. .\ci\ci_windows.ps1 | ||
Tests |
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,51 @@ | ||
name: Deploy to PyPI | ||
|
||
on: | ||
create | ||
|
||
jobs: | ||
deploy: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
source ci/ci_ubuntu.sh | ||
deployment_dependencies | ||
- name: Build Package | ||
run: | | ||
source ci/ci_ubuntu.sh | ||
build | ||
- name: Create artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: plyer_artifact | ||
path: dist | ||
|
||
- name: Upload to GitHub Releases | ||
uses: softprops/[email protected] | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_RELEASE }} | ||
|
||
with: | ||
files: dist/* | ||
draft: true | ||
|
||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
|
||
run: | | ||
source ci/ci_ubuntu.sh | ||
deploy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
dependencies() | ||
{ | ||
python -m pip install --upgrade pip | ||
|
||
pip install --upgrade -r devrequirements.txt | ||
pip install https://github.com/kivy/pyobjus/zipball/master | ||
} | ||
|
||
tests() | ||
{ | ||
pip install --editable . | ||
coverage run \ | ||
--source ./plyer \ | ||
-m unittest discover \ | ||
--start-directory ./plyer/tests \ | ||
--top-level-directory . \ | ||
--failfast | ||
coverage report -m | ||
} |
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,80 @@ | ||
#!/bin/sh | ||
set -ex | ||
|
||
dependencies() | ||
{ | ||
# install default packages | ||
sudo apt-get update && \ | ||
sudo apt-get -y --force-yes install \ | ||
build-essential \ | ||
openjdk-8-jdk \ | ||
lshw \ | ||
wget \ | ||
git \ | ||
&& apt-get -y autoremove \ | ||
&& apt-get -y clean | ||
|
||
# generate user folder locations (Pictures, Downloads, ...) | ||
xdg-user-dirs-update | ||
|
||
# install PIP | ||
python -V | ||
python -m pip install --upgrade pip | ||
|
||
# install dev packages | ||
python -m pip install \ | ||
--upgrade \ | ||
--requirement devrequirements.txt | ||
python -m pip install pyjnius | ||
|
||
python -m pip install . | ||
} | ||
|
||
deployment_dependencies() | ||
{ | ||
python -m pip install --upgrade pip | ||
|
||
pip install setuptools wheel twine | ||
} | ||
|
||
style_dependencies() | ||
{ | ||
python -m pip install --upgrade pip | ||
|
||
pip install flake8 | ||
} | ||
|
||
style() | ||
{ | ||
python -m flake8 . --show-source | ||
} | ||
|
||
tests() | ||
{ | ||
# tests and coverage for plyer package | ||
python -m coverage run \ | ||
--source plyer \ | ||
-m unittest discover \ | ||
--start-directory plyer/tests \ | ||
--top-level-directory . \ | ||
--failfast | ||
|
||
coverage report -m | ||
} | ||
|
||
upload_coverage() | ||
{ | ||
python -m coveralls | ||
} | ||
|
||
build() | ||
{ | ||
python setup.py sdist | ||
python setup.py bdist_wheel --universal | ||
} | ||
|
||
deploy() | ||
{ | ||
# deploy to PyPI | ||
python -m twine upload dist/* | ||
} |
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,19 @@ | ||
function Dependencies { | ||
python -m pip install --requirement devrequirements.txt | ||
python -m pip install . | ||
echo Plyer version is | ||
python -c "import plyer;print(plyer.__version__)" | ||
} | ||
|
||
function Tests { | ||
$current_directory = (pwd).Path | ||
|
||
python -m coverage run ` | ||
--source "$current_directory\plyer" ` | ||
-m unittest discover ` | ||
--start-directory "$current_directory\plyer\tests" ` | ||
--top-level-directory "$current_directory" ` | ||
--failfast | ||
|
||
python -m coverage report -m | ||
} |
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,7 +1,4 @@ | ||
mock | ||
pycodestyle | ||
pylint | ||
coverage | ||
coveralls | ||
cython | ||
twine |