Reformat markdown for ruff 0.16 and pin ruff in CI #53
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
| # Copyright (c) European Space Agency, 2025. | |
| # | |
| # This file is subject to the terms and conditions defined in file 'LICENCE.txt', which | |
| # is part of this source code package. No part of the package, including | |
| # this file, may be copied, modified, propagated, or distributed except according to | |
| # the terms contained in the file 'LICENCE.txt'. | |
| # This workflow will install Python dependencies, run tests and lint with a single version of Python | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Running tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Search for severe code errors with ruff | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| pip install ruff | |
| ruff check . --select=E9,F63,F7,F82,F541 --output-format=full | |
| - name: provision-with-micromamba | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment_CI.yml | |
| environment-name: am | |
| cache-downloads: true | |
| cache-environment: true | |
| - name: Test with pytest | |
| shell: bash -l {0} | |
| run: | | |
| set -e | |
| set -o pipefail | |
| micromamba activate am | |
| pytest --durations=20 --junitxml=pytest.xml --cov-report=xml:coverage.xml --cov-report=term --cov=anomaly_match tests/ | tee pytest-coverage.txt | |
| echo "===== Coverage report =====" | |
| cat pytest-coverage.txt | |
| - name: Pytest coverage comment | |
| uses: MishaKav/pytest-coverage-comment@main | |
| if: always() && github.event_name == 'pull_request' | |
| with: | |
| pytest-coverage-path: ./pytest-coverage.txt | |
| pytest-xml-coverage-path: ./coverage.xml | |
| title: Coverage Report | |
| badge-title: Overall Coverage | |
| hide-badge: false | |
| hide-report: false | |
| create-new-comment: false | |
| hide-comment: false | |
| report-only-changed-files: false | |
| junitxml-path: ./pytest.xml |