From 4dfc7bbc5214c7a439247c3c96c9b62e69f22494 Mon Sep 17 00:00:00 2001 From: Rico Schrage Date: Thu, 19 Oct 2023 12:11:39 +0200 Subject: [PATCH] Added workflow files. --- .github/workflows/publish-mango.yml | 33 +++++++++++++++++++++++++++++ .github/workflows/test-mango.yml | 29 +++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/publish-mango.yml create mode 100644 .github/workflows/test-mango.yml diff --git a/.github/workflows/publish-mango.yml b/.github/workflows/publish-mango.yml new file mode 100644 index 00000000..cbd28f50 --- /dev/null +++ b/.github/workflows/publish-mango.yml @@ -0,0 +1,33 @@ +name: Upload mango + +on: + release: + types: [published] + +jobs: + deploy: + runs-on: python:3.8.10 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + pip install virtualenv + virtualenv venv + source venv/bin/activate + pip3 install -r requirements.txt + pip3 install -e . + apt update + apt install --assume-yes mosquitto + service mosquitto start + pip3 install pytest + pip3 install coverage + - name: Test+Coverage + run: | + coverage run --source ./mango -m pytest + coverage report + - name: Build package + run: python setup.py sdist bdist_wheel + - name: Publish package + uses: pypa/gh-action-pypi-publish@v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test-mango.yml b/.github/workflows/test-mango.yml new file mode 100644 index 00000000..9d7af4bf --- /dev/null +++ b/.github/workflows/test-mango.yml @@ -0,0 +1,29 @@ +name: Test mango + +on: [push] + +permissions: + contents: read + +jobs: + build: + runs-on: python:3.8.10 + + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + pip install virtualenv + virtualenv venv + source venv/bin/activate + pip3 install -r requirements.txt + pip3 install -e . + apt update + apt install --assume-yes mosquitto + service mosquitto start + pip3 install pytest + pip3 install coverage + - name: Test+Coverage + run: | + coverage run --source ./mango -m pytest + coverage report \ No newline at end of file