File: ci.yml

package info (click to toggle)
python-librosa 0.11.0-5
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 166,732 kB
  • sloc: python: 21,731; makefile: 141; sh: 2
file content (145 lines) | stat: -rw-r--r-- 4,725 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI

on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main

concurrency:
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: True

jobs:
    test:
        name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
        runs-on: ${{ matrix.os }}

        strategy:
            fail-fast: false
            matrix:
                include:
                    - os: ubuntu-latest
                      python-version: "3.8"
                      envfile: ".github/environment-minimal.yml"
                      channel-priority: "flexible"
                      name: "Minimal dependencies"

                    - os: ubuntu-latest
                      python-version: "3.9"
                      channel-priority: "strict"
                      envfile: ".github/environment-ci.yml"

                    - os: ubuntu-latest
                      python-version: "3.10"
                      channel-priority: "strict"
                      envfile: ".github/environment-ci.yml"

                    - os: ubuntu-latest
                      python-version: "3.11"
                      channel-priority: "strict"
                      envfile: ".github/environment-ci.yml"

                    - os: ubuntu-latest
                      python-version: "3.12"
                      channel-priority: "strict"
                      envfile: ".github/environment-ci.yml"

                    - os: ubuntu-24.04-arm
                      python-version: "3.13"
                      channel-priority: "strict"
                      envfile: ".github/environment-ci.yml"

                    - os: ubuntu-latest
                      python-version: "3.13"
                      channel-priority: "strict"
                      envfile: ".github/environment-ci.yml"

                    - os: macos-latest
                      python-version: "3.13"
                      channel-priority: "flexible"
                      envfile: ".github/environment-ci.yml"

                    - os: windows-latest
                      python-version: "3.13"
                      channel-priority: "strict"
                      envfile: ".github/environment-ci.yml"

        steps:
        - uses: actions/checkout@v4
          with:
            submodules: true

        - name: Create short temp directory (Windows only)
          if: runner.os == 'Windows'
          run: mkdir C:\tmp
          shell: cmd

        - name: Set environment variables (Windows only)
          if: runner.os == 'Windows'
          run: |
            echo "TMP=C:\tmp" >> $env:GITHUB_ENV
            echo "TEMP=C:\tmp" >> $env:GITHUB_ENV
          shell: pwsh

        - name: Install OS dependencies
          shell: bash -l {0}
          run: |
            case "${{ runner.os }}" in
            Linux)
              sudo apt-get update -yy
              sudo apt-get install -yy  libsamplerate0
              ;; 
            macOS)
              brew install libsamplerate
              ;;
            esac

        - name: Cache conda
          uses: actions/cache@v4
          env:
            # Increase this value to reset cache if etc/example-environment.yml has not changed
            CACHE_NUMBER: 0
          with:
            path: ~/conda_pkgs_dir
            key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles( matrix.envfile ) }}

        - name: Install Conda environment
          uses: conda-incubator/setup-miniconda@v3
          with:
            auto-update-conda: true
            python-version: ${{ matrix.python-version }}
            add-pip-as-python-dependency: true
            auto-activate-base: false
            activate-environment: test
            channel-priority: ${{ matrix.channel-priority }}
            environment-file: ${{ matrix.envfile }}
            use-only-tar-bz2: false # IMPORTANT: This needs to be set for caching to work properly!

        - name: Conda info
          shell: bash -l {0}
          run: |
            conda info -a
            conda list
            python -c "import scipy; scipy.show_config()"

        - name: Install librosa
          shell: bash -l {0}
          run: python -m pip install --upgrade-strategy only-if-needed -e .[tests]

        - name: Run pytest
          shell: bash -l {0}
          run: pytest

        - name: Upload coverage to Codecov
          uses: codecov/codecov-action@v5
          with:
            token: ${{ secrets.CODECOV_TOKEN }}
            files: ./coverage.xml
            flags: unittests
            env_vars: OS,PYTHON
            name: codecov-umbrella
            fail_ci_if_error: true
            verbose: true