TLAB-2569 Add mypy static type checking to CI/CD #76
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: Test | |
| on: | |
| push: | |
| branches: [ "*" ] | |
| pull_request: | |
| branches: [ "*" ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Poetry | |
| run: pipx install poetry | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Type check | |
| run: poetry run mypy sigma/ | |
| - name: Run tests | |
| run: poetry run pytest --cov=sigma --cov-report term --cov-report xml:cov.xml -vv | |
| - name: Store coverage for badge | |
| if: ${{ runner.os == 'Linux' }} | |
| run: poetry run python print-coverage.py >> $GITHUB_ENV | |
| - name: Create coverage badge | |
| if: ${{ github.repository == 'https://github.com/SumoLogic/sumologic' && github.event_name == 'push' && runner.os == 'Linux' }} | |
| uses: schneegans/dynamic-badges-action@v1.7.0 | |
| with: | |
| auth: ${{ secrets.GIST_SECRET }} | |
| gistID: GitHub Gist identifier containing coverage badge JSON expected by shields.io. | |
| filename: https://github.com/SumoLogic-sumologic.json | |
| label: Coverage | |
| message: ${{ env.COVERAGE }} | |
| color: ${{ env.COVERAGE_COLOR }} | |
| - name: Run integration test | |
| # Integration test validates package building, installation, and imports | |
| # Only run on Linux to avoid redundant testing across all platforms | |
| # if: ${{ runner.os == 'Linux' && matrix.python-version == '3.13' }} | |
| if: false | |
| run: sh tests/test_integration.sh |