github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/.github/workflows/operator.yaml (about) 1 name: operator build 2 3 on: 4 push: 5 paths: 6 - 'operator/**' 7 branches: [ main ] 8 pull_request: 9 paths: 10 - 'operator/**' 11 12 jobs: 13 lint: 14 name: lint 15 runs-on: ubuntu-latest 16 strategy: 17 fail-fast: false 18 matrix: 19 go: ['1.18'] 20 steps: 21 - name: Install make 22 run: sudo apt-get install make 23 - name: Set up Go 1.x 24 uses: actions/setup-go@v3 25 with: 26 go-version: ${{ matrix.go }} 27 id: go 28 - uses: actions/checkout@v3 29 - name: Lint 30 uses: golangci/golangci-lint-action@v3.2.0 31 with: 32 version: v1.47.2 33 skip-go-installation: true 34 args: --timeout=4m 35 working-directory: ./operator 36 - name: Check prometheus rules 37 working-directory: ./operator 38 run: make lint-prometheus 39 40 build-manager: 41 name: Build Manager 42 runs-on: ubuntu-latest 43 strategy: 44 fail-fast: false 45 matrix: 46 go: ['1.18'] 47 steps: 48 - name: Install make 49 run: sudo apt-get install make 50 - name: Set up Go 1.x 51 uses: actions/setup-go@v3 52 with: 53 go-version: ${{ matrix.go }} 54 id: go 55 - uses: actions/checkout@v3 56 - name: Build Manager 57 working-directory: ./operator 58 run: |- 59 make manager && git diff --exit-code 60 61 build-broker: 62 name: Build Broker 63 runs-on: ubuntu-latest 64 strategy: 65 fail-fast: false 66 matrix: 67 go: ['1.18'] 68 steps: 69 - name: Install make 70 run: sudo apt-get install make 71 - name: Set up Go 1.x 72 uses: actions/setup-go@v3 73 with: 74 go-version: ${{ matrix.go }} 75 id: go 76 - uses: actions/checkout@v3 77 - name: Build Broker 78 working-directory: ./operator 79 run: |- 80 make bin/loki-broker && git diff --exit-code 81 82 test: 83 name: test 84 runs-on: ubuntu-latest 85 strategy: 86 fail-fast: false 87 matrix: 88 go: ['1.18'] 89 steps: 90 - name: Install make 91 run: sudo apt-get install make 92 - name: Set up Go 1.x 93 uses: actions/setup-go@v3 94 with: 95 go-version: ${{ matrix.go }} 96 id: go 97 - uses: actions/checkout@v3 98 - name: Run tests 99 working-directory: ./operator 100 run: go test -coverprofile=profile.cov ./... 101 - name: Run prometheus rule tests 102 working-directory: ./operator 103 run: make test-unit-prometheus 104 - name: Send coverage 105 uses: shogo82148/actions-goveralls@v1 106 with: 107 working-directory: ./operator 108 path-to-profile: profile.cov 109 flag-name: Go-${{ matrix.go }} 110 shallow: true