Spaces:
Sleeping
Sleeping
Download ytmusicapi/.github/workflows/coverage.yml from veltrixcode/ytm: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/spaces/veltrixcode/ytm/resolve/main/ytmusicapi/.github/workflows/coverage.yml
- Command line
-
hf download hf://spaces/veltrixcode/ytm/ytmusicapi/.github/workflows/coverage.yml
-
curl -L -o coverage.yml https://huggingface.co/spaces/veltrixcode/ytm/resolve/main/ytmusicapi/.github/workflows/coverage.yml
1.56 kB
| name: Code coverage | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ytmusicapi/** | |
| - tests/** | |
| pull_request_target: | |
| paths: | |
| - ytmusicapi/** | |
| - tests/** | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup PDM | |
| uses: pdm-project/setup-pdm@v4 | |
| - name: create-json | |
| uses: jsdaniell/create-json@v1.2.3 | |
| with: | |
| name: "oauth.json" | |
| dir: "tests/" | |
| json: ${{ secrets.OAUTH_JSON }} | |
| - name: Install dependencies | |
| run: pdm install | |
| - name: Generate coverage report | |
| env: | |
| HEADERS_AUTH: ${{ secrets.HEADERS_AUTH }} | |
| TEST_CFG: ${{ secrets.TEST_CFG }} | |
| run: | | |
| curl -o tests/test.mp3 https://www.kozco.com/tech/piano2-CoolEdit.mp3 | |
| cat <<< "$HEADERS_AUTH" > tests/browser.json | |
| cat <<< "$TEST_CFG" > tests/test.cfg | |
| pdm run pytest --junitxml=test-results.xml | |
| pdm run coverage xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| if: ${{ !cancelled() }} | |
| with: | |
| flags: unittests | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: test-results.xml | |