diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..b4de33a --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,30 @@ +name: Code coverage + +on: + push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Setup Python + uses: actions/setup-python@master + with: + python-version: 3.x + - name: Generate coverage report + env: + HEADERS_AUTH: ${{ secrets.HEADERS_AUTH }} + TEST_CFG: ${{ secrets.TEST_CFG }} + run: | + pip install -e . + pip install coverage + cat <<< "$SETTINGS_INI" > spotify_to_ytmusic/settings.ini + coverage run + coverage xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: coverage.xml + flags: unittests + fail_ci_if_error: true diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml new file mode 100644 index 0000000..4b46d0b --- /dev/null +++ b/.github/workflows/pythonpublish.yml @@ -0,0 +1,29 @@ +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }}