all.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. pull_request:
  10. branches: [ '!main' ]
  11. env:
  12. KUBEBUILDER_VERSION: 2.3.1
  13. jobs:
  14. build:
  15. name: Build
  16. container:
  17. image: golang:1.15
  18. runs-on: ubuntu-latest
  19. steps:
  20. - name: Check out code into the Go module directory
  21. uses: actions/checkout@v2
  22. - name: Set up Go
  23. uses: actions/setup-go@v2
  24. with:
  25. go-version: '~1.15'
  26. - name: Add kubebuilder
  27. run: |
  28. 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
  29. tar -xvf kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64.tar.gz
  30. mv kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64 /usr/local/kubebuilder
  31. - name: Lint
  32. run: |
  33. make lint-install
  34. make lint
  35. - name: Build
  36. run: make build
  37. test:
  38. name: Test
  39. container:
  40. image: golang:1.15
  41. runs-on: ubuntu-latest
  42. steps:
  43. - name: Check out code into the Go module directory
  44. uses: actions/checkout@v2
  45. - name: Set up Go
  46. uses: actions/setup-go@v2
  47. with:
  48. go-version: '~1.15'
  49. - name: Add kubebuilder
  50. run: |
  51. 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
  52. tar -xvf kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64.tar.gz
  53. mv kubebuilder_${{env.KUBEBUILDER_VERSION}}_linux_amd64 /usr/local/kubebuilder
  54. - name: Check out code into the Go module directory
  55. uses: actions/checkout@v2
  56. - name: Test
  57. run: make test
  58. - name: Coverage
  59. uses: codecov/codecov-action@v1
  60. with:
  61. # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
  62. file: ./cover.out
  63. # flags: unittests # optional
  64. name: external-secrets
  65. fail_ci_if_error: false