From 1d532f33170393252fd97180841e546081e998a7 Mon Sep 17 00:00:00 2001 From: Mustafa Mohamed Date: Sun, 23 May 2021 17:43:45 -0400 Subject: [PATCH] chore: fix up workflows --- .github/workflows/publish.yml | 21 ++++++++++++ .github/workflows/test_black_formatting.yml | 21 +++++------- .github/workflows/test_linux.yml | 13 +++---- .github/workflows/test_mac.yml | 38 ++++++++++----------- .github/workflows/test_windows.yml | 38 ++++++++++----------- .gitignore | 3 +- 6 files changed, 75 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..74cc327 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Build Wheels + Publish to PyPi + +on: + push: + tags: + - "v*.*.*" + workflow_dispatch: +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python to Build Wheel + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Build and publish to PyPi + uses: JRubics/poetry-publish@v1 + with: + pypi_token: ${{ secrets.PYPI_TOKEN }} + ignore_dev_requirements: "yes" diff --git a/.github/workflows/test_black_formatting.yml b/.github/workflows/test_black_formatting.yml index 118d51a..cfd2dc8 100644 --- a/.github/workflows/test_black_formatting.yml +++ b/.github/workflows/test_black_formatting.yml @@ -6,25 +6,22 @@ name: Test For Black Formatting on: push: branches: - - master - dev pull_request: branches: - - master - dev jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Test Black Formatting - run: | - pip install black - python -m black --check notifypy/ + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Test Black Formatting + run: | + pip install black + python -m black --check notifypy/ diff --git a/.github/workflows/test_linux.yml b/.github/workflows/test_linux.yml index 8ea085d..4d494df 100644 --- a/.github/workflows/test_linux.yml +++ b/.github/workflows/test_linux.yml @@ -6,11 +6,9 @@ name: Test Linux on: push: branches: - - master - dev pull_request: branches: - - master - dev jobs: @@ -28,15 +26,18 @@ jobs: pip install loguru jeepney pytest sudo apt-get install libnotify-bin sudo apt-get install alsa + sudo apt-get install curl + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + exec $SHELL + poetry install - name: Lint with pylint run: | - pip install pylint # stop the build if there are Python syntax errors or undefined names - pylint --errors-only notifypy/ + poetry run pylint --errors-only notifypy/ - name: Test with pytest (Linux dbus) run: | - dbus-run-session -- python -m pytest tests/ + dbus-run-session -- poetry run pytest tests/ - name: Test with pytest (Linux Libnotify) run: | pip uninstall jeepney -y - python -m pytest tests/ + poetry run pytest tests/ diff --git a/.github/workflows/test_mac.yml b/.github/workflows/test_mac.yml index 9ced816..697037a 100644 --- a/.github/workflows/test_mac.yml +++ b/.github/workflows/test_mac.yml @@ -6,33 +6,31 @@ name: Test macOS on: push: branches: - - master - dev pull_request: branches: - - master - dev jobs: build: - runs-on: macos-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Install dependencies - run: | - pip install loguru - - name: Lint with pylint - run: | - pip install pylint - # stop the build if there are Python syntax errors or undefined names - pylint --errors-only notifypy/ - - name: Test with pytest - run: | - pip install pytest - python -m pytest tests/ + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + exec $SHELL + - name: Lint with pylint + run: | + pip install pylint + # stop the build if there are Python syntax errors or undefined names + poetry run pylint --errors-only notifypy/ + - name: Test with pytest + run: | + pip install pytest + poetry run pytest tests/ diff --git a/.github/workflows/test_windows.yml b/.github/workflows/test_windows.yml index 910a951..e89a51c 100644 --- a/.github/workflows/test_windows.yml +++ b/.github/workflows/test_windows.yml @@ -6,33 +6,31 @@ name: Test Windows on: push: branches: - - master - dev pull_request: branches: - - master - dev jobs: build: - runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Install dependencies - run: | - pip install loguru - - name: Lint with pylint - run: | - pip install pylint - # stop the build if there are Python syntax errors or undefined names - pylint --errors-only notifypy/ - - name: Test with pytest - run: | - pip install pytest - python -m pytest tests/ + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + pipx install poetry + poetry install + - name: Lint with pylint + run: | + pip install pylint + # stop the build if there are Python syntax errors or undefined names + poetry run pylint --errors-only notifypy/ + - name: Test with pytest + run: | + pip install pytest + poetry run pytest tests/ diff --git a/.gitignore b/.gitignore index ae10423..d3437a5 100644 --- a/.gitignore +++ b/.gitignore @@ -143,4 +143,5 @@ dmypy.json cython_debug/ # PyCharm -.idea/ \ No newline at end of file +.idea/ +dist/* \ No newline at end of file