Merge pull request #35 from open-mpic/ds-refactor-config #57
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: Hatch Unit Test | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11.9"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up pip cache | |
| if: runner.os == 'Linux' | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: ${{ runner.os }}-pip- | |
| - name: Install Hatch | |
| run: pipx install hatch | |
| - name: Submodule update | |
| run: "git submodule init; git submodule update" | |
| - name: Run tests | |
| run: hatch run test:unit | |
| - name: Check coverage | |
| run: "hatch run test:coverage | grep TOTAL | python -c $'import sys\\nfor line in sys.stdin: \\n coverage = int([s for s in line.split(\" \") if s != \"\"][-1].strip()[:-1])\\n print(coverage)\\n exit(1 if coverage < 94 else 0)'" |