unitTest.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: PR - Docker unit test
  2. on:
  3. pull_request:
  4. branches:
  5. - master
  6. types: [opened, reopened, synchronize, edited]
  7. # Please, always create a pull request instead of push to master.
  8. permissions:
  9. contents: read
  10. pull-requests: write
  11. concurrency:
  12. group: docker-test-${{ github.ref_name }}
  13. cancel-in-progress: true
  14. jobs:
  15. test:
  16. name: Docker tests
  17. runs-on: ubuntu-latest
  18. services:
  19. mysql:
  20. image: mysql
  21. env:
  22. MYSQL_DATABASE: pmail
  23. MYSQL_ROOT_PASSWORD: githubTest
  24. options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
  25. postgres:
  26. image: postgres
  27. env:
  28. POSTGRESQL_PASSWORD: githubTest
  29. container:
  30. image: golang
  31. env:
  32. REPOSITORY: ${{ github.repository }}
  33. TRIGGERING_ACTOR: ${{ github.triggering_actor }}
  34. SOURCE_BRANCH: ${{ github.ref_name }}
  35. COMMIT: ${{ github.workflow_sha }}
  36. EVENT: ${{ github.event_name}}
  37. steps:
  38. - name: Setup Node.js environment
  39. run: apt update && apt install -y nodejs npm
  40. - name: Checkout
  41. uses: actions/checkout@v4
  42. - name: Pull Request Labeler
  43. if: ${{ failure() }}
  44. uses: actions-cool/issues-helper@v3
  45. with:
  46. actions: 'add-labels'
  47. token: ${{ secrets.GITHUB_TOKEN }}
  48. issue-number: ${{ github.event.pull_request.number }}
  49. labels: 'Auto: Test Failed'
  50. - name: Install Dependencies
  51. run: npm install --global yarn
  52. - name: FE build
  53. run: make build_fe
  54. - name: Run Test Mysql
  55. run: make test_mysql
  56. - name: Run Test
  57. run: make test
  58. # - name: Run postgres
  59. # run: make test_postgres