pipeline.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Linting and tests
  2. on:
  3. pull_request:
  4. push:
  5. branches: ["main"]
  6. jobs:
  7. check-code-style:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v2
  11. - uses: actions/setup-python@v2
  12. with:
  13. python-version: '3.6'
  14. - run: python -m pip install -e .[dev]
  15. # Please keep this section up to date with `scripts-dev/lint.sh`.
  16. # TODO: could just run the lint script directly?
  17. - run: black --check --diff sydent/ stubs/ tests/ matrix_is_test/ scripts/ setup.py
  18. - run: flake8 sydent/ tests/ matrix_is_test/ scripts/ setup.py
  19. - run: flake8 stubs/ --ignore E301,E302,E305,E701,E704
  20. - run: isort --check-only --diff sydent/ stubs/ tests/ matrix_is_test/ scripts/ setup.py
  21. run-unit-tests:
  22. needs: [check-code-style]
  23. runs-on: ubuntu-latest
  24. strategy:
  25. matrix:
  26. python-version: ['3.6', '3.x']
  27. steps:
  28. - uses: actions/checkout@v2
  29. - uses: actions/setup-python@v2
  30. with:
  31. python-version: ${{ matrix.python-version }}
  32. - run: python -m pip install -e .
  33. - run: trial tests
  34. run-matrix-is-tests:
  35. needs: [check-code-style]
  36. runs-on: ubuntu-latest
  37. strategy:
  38. matrix:
  39. python-version: ['3.6', '3.x']
  40. steps:
  41. - uses: actions/checkout@v2
  42. - uses: actions/setup-python@v2
  43. with:
  44. python-version: ${{ matrix.python-version }}
  45. - run: python -m pip install -e .
  46. - run: pip install git+https://github.com/matrix-org/matrix-is-tester.git
  47. - run: trial matrix_is_tester