unit-tests.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ---
  2. name: Unit Tests
  3. on:
  4. push:
  5. branches:
  6. - master
  7. pull_request:
  8. types:
  9. - opened
  10. - edited
  11. - synchronize
  12. jobs:
  13. unit_tests:
  14. name: Unit tests
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v2
  18. # Cache
  19. - uses: actions/cache@v1
  20. with:
  21. path: ~/.npm
  22. key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  23. restore-keys: |
  24. ${{ runner.os }}-node-
  25. - uses: actions/cache@v1
  26. with:
  27. path: ~/.cache/pip
  28. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  29. restore-keys: |
  30. ${{ runner.os }}-pip-
  31. # Setup
  32. - name: Install snappy dep
  33. run: sudo apt-get install libsnappy-dev
  34. - name: Set up Python 3.9
  35. uses: actions/setup-python@v1
  36. with:
  37. python-version: 3.9
  38. - name: Set up Nodejs 16
  39. uses: actions/setup-node@v1
  40. with:
  41. node-version: 16
  42. - name: Set up ruby 2.6
  43. uses: actions/setup-ruby@v1
  44. with:
  45. ruby-version: '2.6'
  46. - name: Install virtualenv
  47. run: pip install virtualenv
  48. - name: Install dependencies
  49. run: make setup
  50. # Run Tests
  51. - name: CloudFormation unit tests
  52. run: make test-cfn
  53. - name: Backend unit tests
  54. run: make test-ci
  55. env:
  56. AWS_DEFAULT_REGION: eu-west-1
  57. - name: Frontend unit tests
  58. run: make test-frontend
  59. - name: Upload unit test coverage reports to Codecov
  60. uses: codecov/codecov-action@v1