Repository navigation
Acu add sin el nod #3443
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Tests | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - 'docs/**' | |
| - '**.rst' | |
| - '**.md' | |
| - '.flake8' | |
| - '.pre-commit-config.yaml' | |
| - '.readthedocs.yaml' | |
| - '.github/dependabot.yml' | |
| workflow_call: | |
| # Cancel workflow runs if a new commit is pushed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-test: | |
| name: Run unit tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| # Don't test in 3.12 until #1041 is fixed | |
| # https://github.com/simonsobs/socs/issues/1041 | |
| python: ["3.10", "3.11"] | |
| steps: | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Clone socs | |
| uses: actions/checkout@v7 | |
| - name: Install socs | |
| run: | | |
| pip3 install -r requirements.txt | |
| pip3 install -e . | |
| - name: Run unit tests | |
| working-directory: ./tests | |
| run: | | |
| COVERAGE_FILE=.coverage.unit-${{ matrix.python }} python3 -m pytest --cov -m 'not integtest' | |
| - name: Upload coverage file artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-${{ matrix.python }} | |
| include-hidden-files: true | |
| path: ./tests/.coverage.* | |
| integ-test: | |
| name: Run integration tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| strategy: | |
| matrix: | |
| marker: | |
| - 'http' | |
| - 'hwp' | |
| - 'pysmurf' | |
| - 'serial' | |
| - 'snmp' | |
| - 'tcp' | |
| steps: | |
| - name: Install system packages | |
| run: | | |
| sudo apt-get install -y socat | |
| # Run on a single version, since these tests are run in Docker | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: 3.11 | |
| - name: Clone socs | |
| uses: actions/checkout@v7 | |
| - name: Install socs | |
| run: | | |
| pip3 install -r requirements.txt | |
| pip3 install -e . | |
| - name: Run ${{ matrix.marker }} integration tests | |
| working-directory: ./tests | |
| run: | | |
| COVERAGE_FILE=.coverage.int.${{ matrix.marker }} python3 -m pytest --cov -m 'integtest and ${{ matrix.marker }}' | |
| - name: Upload coverage file artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-integ-${{ matrix.marker }} | |
| include-hidden-files: true | |
| path: ./tests/.coverage.* | |
| upload-coverage: | |
| name: Upload coverage | |
| needs: [unit-test, integ-test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: 3.11 | |
| - name: Install coverage | |
| run: | | |
| python -m pip install coverage | |
| # Coverage report doesn't work unless we have a checkout | |
| - name: Clone socs | |
| uses: actions/checkout@v7 | |
| # Download after checkout, else artifacts get deleted | |
| - name: Download coverage artifacts | |
| uses: actions/download-artifact@v8 | |
| - name: List coverage output for upload | |
| run: | | |
| ls -lthra | |
| ls -lthra coverage* | |
| pwd | |
| - name: Report and upload test coverage | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| mv ./coverage-*/.coverage.* ./ | |
| coverage combine | |
| coverage report | |
| pip install -U coveralls | |
| coveralls --service=github |