test.yml 963 B

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