File: ci.yaml

package info (click to toggle)
beets 2.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,016 kB
  • sloc: python: 46,429; javascript: 8,018; xml: 334; sh: 261; makefile: 125
file content (104 lines) | stat: -rw-r--r-- 3,343 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Test
on:
  pull_request:
  push:
    branches:
      - master

concurrency:
  # Cancel previous workflow run when a new commit is pushed to a feature branch
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
  PY_COLORS: 1

jobs:
  test:
    name: Run tests
    strategy:
      fail-fast: false
      matrix:
        platform: [ubuntu-latest, windows-latest]
        python-version: ["3.9", "3.10", "3.11", "3.12"]
    runs-on: ${{ matrix.platform }}
    env:
      IS_MAIN_PYTHON: ${{ matrix.python-version == '3.9' && matrix.platform == 'ubuntu-latest' }}
    steps:
      - uses: actions/checkout@v4
      - name: Install Python tools
        uses: BrandonLWhite/pipx-install-action@v1.0.3
      - name: Setup Python with poetry caching
        # poetry cache requires poetry to already be installed, weirdly
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          cache: poetry

      - name: Install PyGobject and release script dependencies on Ubuntu
        if: matrix.platform == 'ubuntu-latest'
        run: |
          sudo apt update
          sudo apt install --yes --no-install-recommends ffmpeg gobject-introspection gstreamer1.0-plugins-base python3-gst-1.0 libcairo2-dev libgirepository-2.0-dev pandoc imagemagick

      - name: Get changed lyrics files
        id: lyrics-update
        uses: tj-actions/changed-files@v46
        with:
          files: |
            beetsplug/lyrics.py
            test/plugins/test_lyrics.py

      - name: Add pytest annotator
        uses: liskin/gh-problem-matcher-wrap@v3
        with:
          linters: pytest
          action: add

      - if: ${{ env.IS_MAIN_PYTHON != 'true' }}
        name: Test without coverage
        run: |
          poetry install --without=lint --extras=autobpm --extras=lyrics --extras=replaygain --extras=reflink --extras=fetchart --extras=chroma --extras=sonosupdate
          poe test

      - if: ${{ env.IS_MAIN_PYTHON == 'true' }}
        name: Test with coverage
        env:
          LYRICS_UPDATED: ${{ steps.lyrics-update.outputs.any_changed }}
        run: |
          poetry install --extras=autobpm --extras=lyrics --extras=docs --extras=replaygain --extras=reflink --extras=fetchart --extras=chroma --extras=sonosupdate
          poe docs
          poe test-with-coverage

      - if: ${{ !cancelled() }}
        name: Upload test results to Codecov
        uses: codecov/test-results-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}

      - if: ${{ env.IS_MAIN_PYTHON == 'true' }}
        name: Store the coverage report
        uses: actions/upload-artifact@v4
        with:
          name: coverage-report
          path: .reports/coverage.xml

  upload-coverage:
    name: Upload coverage report
    needs: test
    runs-on: ubuntu-latest
    permissions:
      id-token: write
    steps:
      - uses: actions/checkout@v4

      - name: Get the coverage report
        uses: actions/download-artifact@v4
        with:
          name: coverage-report

      - name: Upload code coverage
        uses: codecov/codecov-action@v5
        with:
          files: ./coverage.xml
          use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}