all.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: all-ci
  2. on:
  3. push:
  4. branches:
  5. - '*' # matches every branch that doesn't contain a '/'
  6. - '*/*' # matches every branch containing a single '/'
  7. - '**' # matches every branch
  8. - '!main' # excludes main
  9. paths-ignore:
  10. - 'deploy/**'
  11. pull_request:
  12. branches: [ '!main' ]
  13. paths-ignore:
  14. - 'deploy/**'
  15. env:
  16. KUBEBUILDER_VERSION: 2.3.1
  17. jobs:
  18. build:
  19. name: Build
  20. container:
  21. image: golang:1.15
  22. runs-on: ubuntu-latest
  23. steps:
  24. - name: Check out code into the Go module directory
  25. uses: actions/checkout@v2
  26. - name: Set up Go
  27. uses: actions/setup-go@v2
  28. with:
  29. go-version: '~1.15'
  30. - name: Add kubebuilder
  31. run: |
  32. curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${{env.KUBEBUILDER_VERSION}}/kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64.tar.gz > kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64.tar.gz
  33. tar -xvf kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64.tar.gz
  34. mv kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64 /usr/local/kubebuilder
  35. - name: Lint
  36. run: |
  37. make lint-install
  38. make lint
  39. - name: Build
  40. run: make build
  41. test:
  42. name: Test
  43. container:
  44. image: golang:1.15
  45. runs-on: ubuntu-latest
  46. steps:
  47. - name: Check out code into the Go module directory
  48. uses: actions/checkout@v2
  49. - name: Set up Go
  50. uses: actions/setup-go@v2
  51. with:
  52. go-version: '~1.15'
  53. - name: Add kubebuilder
  54. run: |
  55. curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${{env.KUBEBUILDER_VERSION}}/kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64.tar.gz > kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64.tar.gz
  56. tar -xvf kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64.tar.gz
  57. mv kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64 /usr/local/kubebuilder
  58. - name: Check out code into the Go module directory
  59. uses: actions/checkout@v2
  60. - name: Test
  61. run: make test
  62. - name: Coverage
  63. uses: codecov/codecov-action@v1
  64. with:
  65. # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
  66. file: ./cover.out
  67. # flags: unittests # optional
  68. name: external-secrets
  69. fail_ci_if_error: false