diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 8568fb78..f74ee556 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -1,6 +1,6 @@ name: Black -on: [pull_request, push] +on: [ pull_request ] jobs: black: @@ -8,10 +8,10 @@ jobs: steps: - name: Checkout repository. - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python. - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.7 diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 8f2081ad..6f3d295b 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -11,10 +11,10 @@ jobs: steps: - name: Checkout repository. - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python. - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.7 diff --git a/.github/workflows/codeql_analysis.yml b/.github/workflows/codeql_analysis.yml deleted file mode 100644 index 8db22452..00000000 --- a/.github/workflows/codeql_analysis.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: CodeQL - -on: - push: - pull_request: - schedule: - - cron: '0 8 * * 1' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - steps: - - name: Checkout repository. - uses: actions/checkout@v2 - - - name: Initialize CodeQL. - uses: github/codeql-action/init@v1 - with: - languages: 'python' - - - name: Perform CodeQL Analysis. - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index b3e839e1..2ff019ee 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,11 +1,9 @@ -name: Build and upload package to PyPI +name: Build and publish package to PyPI on: - push: - branches: - - pypi + workflow_dispatch: release: - types: [created] + types: [ created ] jobs: build_and_publish: @@ -13,14 +11,15 @@ jobs: steps: - name: Checkout repository. - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python. - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.7 - name: Publish a Python distribution to PyPI. + if: github.ref == 'refs/heads/main' && github.repository == 'MarshalX/yandex-music-api' env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml deleted file mode 100644 index 7782c9cb..00000000 --- a/.github/workflows/pytest.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: pytest - -on: [push] - -jobs: - pytest: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository. - uses: actions/checkout@v2 - - - name: Setup Python. - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install dependencies. - run: pip install -r requirements-dev.txt - - - name: Test with pytest. - run: pytest -vv diff --git a/.github/workflows/pytest_full.yml b/.github/workflows/test.yml similarity index 62% rename from .github/workflows/pytest_full.yml rename to .github/workflows/test.yml index f2579ef2..aa5a3a6e 100644 --- a/.github/workflows/pytest_full.yml +++ b/.github/workflows/test.yml @@ -1,28 +1,25 @@ -name: pytest on many platforms +name: Unit tests on: - push: - branches: - - main pull_request: branches: - main jobs: - pytest: + unit_tests: runs-on: ${{matrix.os}} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + os: [ macos-latest, ubuntu-latest, windows-latest ] + python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ] steps: - name: Checkout repository. - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python ${{ matrix.python-version }}. - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }}