Feature/owasp dt 5 (#10) #19
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 | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| test-and-build: | |
| name: "Test" | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run docker-compose | |
| uses: hoverkraft-tech/compose-action@v2.0.1 | |
| with: | |
| compose-file: "./test/docker-compose.yml" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| cache: "pip" | |
| cache-dependency-path: pyproject.toml | |
| - run: pip install -e .[test] | |
| - name: Run tests | |
| env: | |
| PYTHONPATH: "." | |
| run: | | |
| pytest --junitxml=./test-results/tests.xml --cov=./owasp_dt ./test | |
| - name: Publish test results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: | | |
| test-results/**/*.xml | |
| - name: Generate coverage report | |
| run: coverage xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| continue-on-error: true | |
| with: | |
| #fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| verbose: true |