build_test.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: gin-vue-admin build test
  2. on:
  3. push:
  4. branches:
  5. - "*"
  6. paths-ignore:
  7. - "./db/**"
  8. - "**.md"
  9. pull_request:
  10. branches:
  11. - "*"
  12. paths-ignore:
  13. - "./db/**"
  14. - "**.md"
  15. jobs:
  16. frontend:
  17. name: Frontend build
  18. runs-on: ubuntu-latest
  19. strategy:
  20. matrix:
  21. node-version: [12.x]
  22. steps:
  23. - name: Check out branch
  24. uses: actions/checkout@v2
  25. - name: Use Node.js ${{ matrix.node-version }}
  26. uses: actions/setup-node@v1
  27. with:
  28. node-version: ${{ matrix.node-version }}
  29. - name: Build test
  30. run: |
  31. npm install
  32. npm run build
  33. working-directory: ./web
  34. backend:
  35. name: Backend build
  36. runs-on: ubuntu-latest
  37. steps:
  38. - name: Set up Go 1.6
  39. uses: actions/setup-go@v1
  40. with:
  41. go-version: 1.16
  42. id: go
  43. - name: Check out branch
  44. uses: actions/checkout@v2
  45. - name: Download dependencies
  46. run: |
  47. go get -v -t -d ./...
  48. if [ -f Gopkg.toml ]; then
  49. curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
  50. dep ensure
  51. fi
  52. working-directory: ./server
  53. - name: Test and Build
  54. run: |
  55. go build -v -race
  56. working-directory: ./server