|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Regression tests |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + paths: |
| 9 | + - '**.py' |
| 10 | + - 'g*.sh' |
| 11 | + - 'src/kibot' |
| 12 | + - 'tests/**' |
| 13 | + - '.github/workflows/pythonapp.yml' |
| 14 | + - 'tools/dev_image/Dockerfile' |
| 15 | + - 'tools/dev_image_k6/Dockerfile' |
| 16 | + pull_request: |
| 17 | + paths: |
| 18 | + - '**.py' |
| 19 | + - 'g*.sh' |
| 20 | + - 'src/kibot' |
| 21 | + - 'tests/**' |
| 22 | + - '.github/workflows/pythonapp.yml' |
| 23 | + - 'tools/dev_image/Dockerfile' |
| 24 | + - 'tools/dev_image_k6/Dockerfile' |
| 25 | + repository_dispatch: |
| 26 | + types: [run_tests] |
| 27 | + workflow_dispatch: |
| 28 | + |
| 29 | +jobs: |
| 30 | + test: |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + ki_release: [ki9] |
| 35 | + w_tests: [g3] |
| 36 | + |
| 37 | + runs-on: ubuntu-latest |
| 38 | + container: ghcr.io/inti-cmnb/kicad_auto_test:${{ matrix.ki_release }} |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + with: |
| 43 | + submodules: recursive |
| 44 | + - name: Test ${{ matrix.ki_release }} |
| 45 | + env: |
| 46 | + KI_RELEASE: ${{ matrix.ki_release }} |
| 47 | + PIP_OPS: ${{ matrix.ki_release != 'ki5' && '--break-system-packages' || ''}} |
| 48 | + run: | |
| 49 | + rm -rf output |
| 50 | + rm -f tests/.local |
| 51 | + ##### Experimental stuff: |
| 52 | + ## Remove KiAuto |
| 53 | + #dpkg --remove --force-all kiauto |
| 54 | + ## Install KiAuto@master |
| 55 | + #curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip |
| 56 | + #unzip pp.zip |
| 57 | + #pip3 install ${PIP_OPS} KiAuto-master/ |
| 58 | + ## Clean the downloaded stuff |
| 59 | + #rm -rf KiAuto-master/ pp.zip |
| 60 | + ## Install KiDiff@master |
| 61 | + #curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip |
| 62 | + #unzip pp.zip |
| 63 | + #pip3 install ${PIP_OPS} KiDiff-master/ |
| 64 | + ## Clean the downloaded stuff |
| 65 | + #rm -rf KiDiff-master/ pp.zip |
| 66 | + ## Check what we got |
| 67 | + #echo $PATH |
| 68 | + #ls -la /usr/bin/*_do || true |
| 69 | + #ls -la /usr/local/bin/*_do || true |
| 70 | + #which pcbnew_do |
| 71 | + #pcbnew_do --version |
| 72 | + # KiDiff tests |
| 73 | + #curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/kiri_mode --output pp.zip |
| 74 | + #unzip pp.zip |
| 75 | + #prefix=/usr make -C KiDiff-kiri_mode install |
| 76 | + #rm -rf KiDiff-kiri_mode/ pp.zip |
| 77 | + #kicad-diff.py --version |
| 78 | + ##### End Experimental stuff |
| 79 | + # Ensure we start a fresh coverage meassurement |
| 80 | + python3-coverage erase |
| 81 | + # Create the caches with macros |
| 82 | + python3-coverage run src/kibot --help-outputs > /dev/null |
| 83 | + # Individual run for specific tests |
| 84 | + # pytest --log-cli-level debug -k "test_ibom_parse_fail" --test_dir=output |
| 85 | + # Run the 90% faster tests (under 3 s) together |
| 86 | + # Do it in parallel |
| 87 | + ./${{ matrix.w_tests }}.sh |
| 88 | + - name: Store results |
| 89 | + if: ${{ always() }} |
| 90 | + uses: actions/upload-artifact@v4 |
| 91 | + with: |
| 92 | + name: Test_Output_${{ matrix.ki_release }}_${{ matrix.w_tests }} |
| 93 | + # Important! empty directories are skipped!!!! |
| 94 | + path: output |
| 95 | + include-hidden-files: true |
0 commit comments