File: testing.yml

package info (click to toggle)
scikit-rf 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 80,716 kB
  • sloc: python: 33,009; makefile: 130; sh: 19
file content (96 lines) | stat: -rw-r--r-- 2,556 bytes parent folder | download | duplicates (2)
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
name: Code testing

on: [push, pull_request]

jobs:
  Tests:

    runs-on: ubuntu-latest
    permissions:
      checks: write
      pull-requests: write
    strategy:
      matrix:
        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

    steps:
    - uses: actions/checkout@v4
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}
    - uses: yezz123/setup-uv@v4

    - name: Install minimal dependencies
      run: |
        uv venv
        uv pip install -e .
        . .venv/bin/activate
        python -c "import skrf; print(skrf.__version__)"  # Test import with minimal dependencies

    # run the tests located in skrf/
    - name: Test the code, tutorials and examples
      if: ${{ always() }}
      run: |
        uv pip install -e .[test,visa,netw,xlsx,plot,docs,testspice] --compile
        . .venv/bin/activate
        python -m pytest -n auto --junitxml=test-results/junit-${{ matrix.python-version }}.xml --junit-prefix=${{ matrix.python-version }}

    - name: Upload Test Results
      if: always()
      uses: actions/upload-artifact@v4
      with:
        name: Test Results (Python ${{ matrix.python-version }})
        path: test-results/*.xml


    # Upload coverage data to coveralls.io
    - name: Upload coverage data to coveralls.io
      continue-on-error: true
      if: ${{ always() }}
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
        COVERALLS_PARALLEL: true
      run: |
        pip install coveralls
        coveralls --service=github

  coveralls:
    name: Indicate completion to coveralls.io (Finish)
    continue-on-error: true
    if: ${{ always() }}
    needs: Tests
    runs-on: ubuntu-latest
    container: python:3-slim
    steps:
      - name: Finished
        run: |
          pip3 install --upgrade coveralls
          coveralls --finish
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


  publish-test-results:
    name: "Publish Tests Results"
    needs: Tests
    runs-on: ubuntu-latest
    permissions:
      checks: write

      # only needed unless run with comment_mode: off
      pull-requests: write

    if: always()

    steps:
      - name: Download Artifacts
        uses: actions/download-artifact@v4
        with:
          path: artifacts

      - name: Publish Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2
        with:
          files: "artifacts/**/*.xml"