pr.yaml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. name: Develop PR - build test
  2. on:
  3. pull_request:
  4. branches:
  5. - develop
  6. push:
  7. branches:
  8. - develop
  9. jobs:
  10. backend:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. with:
  15. path: ./
  16. -
  17. name: Install just
  18. uses: extractions/setup-just@v1
  19. -
  20. name: Install Go
  21. uses: actions/setup-go@v4
  22. with:
  23. go-version: 'stable'
  24. # Saves us from having to redownload all modules
  25. - name: Go Mod cache
  26. uses: actions/cache@v3
  27. with:
  28. path: |
  29. ~/.cache/go-build
  30. ~/go/pkg/mod
  31. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  32. -
  33. name: Test
  34. run: |
  35. just test
  36. - name: Get branch name
  37. shell: bash
  38. run: echo "BRANCH_NAME=$(echo ${GITHUB_REF} | tr / -)" >> $GITHUB_ENV
  39. - name: save coverage file
  40. uses: actions/upload-artifact@v3
  41. with:
  42. path: ./coverage.out
  43. name: coverage-${{ env.BRANCH_NAME }}-${{ github.sha }}
  44. -
  45. name: Build
  46. run: |
  47. just build-local
  48. frontend:
  49. runs-on: ubuntu-latest
  50. steps:
  51. - uses: actions/checkout@v2
  52. with:
  53. path: ./
  54. -
  55. name: Install just
  56. uses: extractions/setup-just@v1
  57. -
  58. name: Install node
  59. uses: actions/setup-node@v3
  60. with:
  61. node-version: '18.3.0'
  62. - name: Get npm cache directory
  63. id: npm-cache-dir
  64. shell: bash
  65. run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
  66. - uses: actions/cache@v3
  67. id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
  68. with:
  69. path: ${{ steps.npm-cache-dir.outputs.dir }}
  70. key: ${{ runner.os }}-node-${{ hashFiles('./ui/**/package-lock.json') }}
  71. restore-keys: |
  72. ${{ runner.os }}-node-
  73. -
  74. name: Build
  75. working-directory: ./ui
  76. run: |
  77. just build-local