feat(library): add statistics dashboard panel #312
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: CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| if: | | |
| github.event_name != 'push' || | |
| ( | |
| !contains(github.event.head_commit.message, '[skip ci]') && | |
| !contains(github.event.head_commit.message, '[skip-release]') | |
| ) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements.txt' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff | |
| - name: Lint with Ruff | |
| run: | | |
| ruff check . --ignore C901,D417 | |
| test: | |
| if: | | |
| github.event_name != 'push' || | |
| ( | |
| !contains(github.event.head_commit.message, '[skip ci]') && | |
| !contains(github.event.head_commit.message, '[skip-release]') | |
| ) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - lane: fast | |
| marker: "not slow" | |
| timeout: 10 | |
| - lane: slow | |
| marker: "slow" | |
| timeout: 10 | |
| timeout-minutes: ${{ matrix.timeout }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements.txt' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install pytest pytest-timeout pytest-cov pytest-xdist | |
| - name: Run ${{ matrix.lane }} tests | |
| run: | | |
| pytest -v --tb=short -m "${{ matrix.marker }}" \ | |
| -n auto \ | |
| --cov=src --cov-report=xml:coverage-${{ matrix.lane }}.xml \ | |
| --cov-report=term-missing | |
| - name: Upload coverage to Codecov | |
| if: always() | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage-${{ matrix.lane }}.xml | |
| flags: ${{ matrix.lane }} | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload .coverage data | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-data-${{ matrix.lane }} | |
| path: .coverage | |
| include-hidden-files: true | |
| ci: | |
| runs-on: ubuntu-latest | |
| needs: [lint, test] | |
| if: always() | |
| steps: | |
| - name: Check required jobs | |
| run: | | |
| if [[ "${{ needs.lint.result }}" != "success" || "${{ needs.test.result }}" != "success" ]]; then | |
| echo "Required jobs failed: lint=${{ needs.lint.result }}, test=${{ needs.test.result }}" | |
| exit 1 | |
| fi |