Add DNSMOS Pro #115
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: VERSA CI | |
| on: | |
| push: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 # Updated to v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install black flake8 pre-commit | |
| pip install -e . | |
| - name: Run pre-commit hooks with auto-fix | |
| run: | | |
| pre-commit run --all-files | |
| - name: Commit auto-fixes | |
| uses: stefanzweifel/git-auto-commit-action@v4 | |
| with: | |
| commit_message: "style: auto-fix code formatting with pre-commit" | |
| branch: ${{ github.head_ref || github.ref_name }} | |
| if: github.event_name == 'pull_request' # Only auto-commit on PRs | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 versa scripts test *.py --count --select=E9,F63,F7,F82 --show-source --statistics | |
| flake8 versa scripts test *.py --count --exit-zero --max-line-length=127 --statistics | |
| install-tests: | |
| needs: code-quality | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-22.04] | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 # Updated to v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest | |
| pip install -e . | |
| - name: Test installation | |
| run: | | |
| python -c "import versa; print(versa.__version__)" | |
| basic-tests: | |
| needs: install-tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 # Updated to v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest pytest-cov | |
| pip install -e . | |
| - name: Run basic tests | |
| run: | | |
| pytest -xvs test/test_general.py | |
| metric-tests: | |
| needs: basic-tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 # Updated to v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest pytest-cov | |
| pip install -e . | |
| - name: Run metric tests | |
| run: | | |
| pytest -xvs test/test_metrics/ | |
| # Optionally, you can generate a coverage report | |
| # pytest -xvs test/test_metrics/ --cov=versa.metrics --cov-report=xml |