tunasync.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: tunasync
  2. on: [push]
  3. jobs:
  4. build:
  5. name: Build
  6. runs-on: ubuntu-latest
  7. steps:
  8. - name: Set up Go 1.13
  9. uses: actions/setup-go@v1
  10. with:
  11. go-version: 1.13
  12. id: go
  13. - name: Check out code into the Go module directory
  14. uses: actions/checkout@v2
  15. - name: Get dependencies
  16. run: |
  17. go get -v -t -d ./cmd/tunasync
  18. go get -v -t -d ./cmd/tunasynctl
  19. - name: Build
  20. run: |
  21. make tunasync
  22. make tunasynctl
  23. test:
  24. name: Test
  25. runs-on: ubuntu-latest
  26. steps:
  27. - name: Setup test dependencies
  28. run: |
  29. sudo apt-get install cgroup-bin docker.io
  30. lssubsys -am
  31. sudo cgcreate -a $USER -t $USER -g cpu:tunasync
  32. sudo cgcreate -a $USER -t $USER -g memory:tunasync
  33. sudo docker pull alpine
  34. - name: Set up Go 1.13
  35. uses: actions/setup-go@v1
  36. with:
  37. go-version: 1.13
  38. id: go
  39. - name: Check out code into the Go module directory
  40. uses: actions/checkout@v2
  41. - name: Run Unit tests.
  42. run: make test
  43. - name: Convert coverage to lcov
  44. uses: jandelgado/gcov2lcov-action@v1.0.0
  45. with:
  46. infile: profile.cov
  47. outfile: coverage.lcov
  48. - name: Coveralls
  49. uses: coverallsapp/github-action@v1.0.1
  50. with:
  51. github-token: ${{ secrets.github_token }}
  52. path-to-lcov: coverage.lcov