tests.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. name: Python tests
  2. on: [push, pull_request]
  3. jobs:
  4. tests:
  5. runs-on: ubuntu-latest
  6. strategy:
  7. matrix:
  8. python-version: [3.8]
  9. steps:
  10. - uses: actions/checkout@v2
  11. with:
  12. fetch-depth: 0
  13. - name: Set up Python ${{ matrix.python-version }}
  14. uses: actions/setup-python@v2
  15. with:
  16. python-version: ${{ matrix.python-version }}
  17. - name: Install dependencies
  18. run: |
  19. python -m pip install --upgrade pip
  20. pip install -r requirements-first.txt
  21. pip install -r requirements-dev.txt
  22. - name: Test with pytest
  23. run: pytest --cov=. --cov-config=.coveragerc --cov-report xml:coverage.xml
  24. - name: Track master branch
  25. run: git fetch --no-tags https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY +refs/heads/main:refs/remotes/origin/main
  26. - name: SonarCloud scan
  27. uses: sonarsource/sonarcloud-github-action@master
  28. env:
  29. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  30. SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}