test.yml 1005 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. name: Test
  2. on:
  3. pull_request:
  4. branches:
  5. - develop
  6. push:
  7. branches:
  8. - develop
  9. jobs:
  10. test:
  11. name: Test
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Checkout repository
  15. uses: actions/checkout@v4
  16. - name: Set up Go
  17. uses: actions/setup-go@v5
  18. with:
  19. go-version: ^1.21.0
  20. - name: Display Go version
  21. run: go version
  22. - name: Install dependencies
  23. run: go get
  24. - name: Run tests
  25. run: go test -v
  26. notify:
  27. name: Send Discord workflow notification
  28. runs-on: ubuntu-latest
  29. needs: test
  30. steps:
  31. - name: Send notification
  32. uses: annybs/action-notify-discord@v1
  33. if: ${{ always() }}
  34. with:
  35. repository: ${{ github.repository }}
  36. result: ${{ needs.test.result }}
  37. run-id: ${{ github.run_id }}
  38. run-number: ${{ github.run_number }}
  39. webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
  40. workflow: ${{ github.workflow }}