|
1 | 1 | name: Build, Lint, and Test |
2 | 2 | on: |
3 | | - push: |
4 | | - branches: |
5 | | - - main |
6 | | - tags: |
7 | | - - '*' |
8 | | - pull_request: |
9 | | - branches: |
10 | | - - main |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + tags: |
| 7 | + - "*" |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - build: |
14 | | - name: Build |
15 | | - runs-on: ubuntu-latest |
16 | | - steps: |
17 | | - - name: Checkout code |
18 | | - uses: actions/checkout@v4 |
19 | | - - name: Set up Go |
20 | | - uses: actions/setup-go@v5 |
21 | | - with: |
22 | | - go-version: stable |
23 | | - - name: Install Dependencies |
24 | | - run: go mod download |
25 | | - - name: Build Octometrics |
26 | | - run: go build -o octometrics-binary . |
27 | | - - name: Upload binary |
28 | | - uses: actions/upload-artifact@v4 |
29 | | - with: |
30 | | - name: octometrics-binary |
31 | | - path: octometrics-binary |
32 | | - retention-days: 1 |
33 | | - if-no-files-found: error |
| 13 | + build: |
| 14 | + name: Build |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v6 |
| 19 | + - name: Set up Go |
| 20 | + uses: actions/setup-go@v6 |
| 21 | + with: |
| 22 | + go-version: stable |
| 23 | + - name: Install Dependencies |
| 24 | + run: go mod download |
| 25 | + - name: Build Octometrics |
| 26 | + run: go build -o octometrics-binary . |
| 27 | + - name: Upload binary |
| 28 | + uses: actions/upload-artifact@v7 |
| 29 | + with: |
| 30 | + name: octometrics-binary |
| 31 | + path: octometrics-binary |
| 32 | + retention-days: 1 |
| 33 | + if-no-files-found: error |
34 | 34 |
|
35 | | - test: |
36 | | - name: Test |
37 | | - needs: build |
38 | | - runs-on: ubuntu-latest |
39 | | - steps: |
40 | | - - name: Download Built Binary |
41 | | - uses: actions/download-artifact@v4 |
42 | | - with: |
43 | | - name: octometrics-binary |
44 | | - path: . |
45 | | - - name: Monitor |
46 | | - uses: kalverra/octometrics-action@v0.0.5 |
47 | | - with: |
48 | | - job_name: Test |
49 | | - version: ./octometrics-binary |
50 | | - env: |
51 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
52 | | - - name: Checkout code |
53 | | - uses: actions/checkout@v4 |
54 | | - - name: Setup Go |
55 | | - uses: actions/setup-go@v5 |
56 | | - with: |
57 | | - go-version: stable |
58 | | - - name: Install Dependencies |
59 | | - run: go mod download |
60 | | - - name: Run tests |
61 | | - run: OCTOMETRICS_TEST_LOG_LEVEL=trace go tool gotestsum --junitfile junit.xml -- -coverprofile=cover.out ./... |
62 | | - - name: Upload coverage reports to Codecov |
63 | | - uses: codecov/codecov-action@v5 |
64 | | - with: |
65 | | - token: ${{ secrets.CODECOV_TOKEN }} |
66 | | - files: cover.out |
67 | | - - name: Upload test results to Codecov |
68 | | - if: ${{ !cancelled() }} |
69 | | - uses: codecov/test-results-action@v1 |
70 | | - with: |
71 | | - token: ${{ secrets.CODECOV_TOKEN }} |
| 35 | + test: |
| 36 | + name: Test |
| 37 | + needs: build |
| 38 | + runs-on: ubuntu-latest |
| 39 | + steps: |
| 40 | + - name: Download Built Binary |
| 41 | + uses: actions/download-artifact@v8 |
| 42 | + with: |
| 43 | + name: octometrics-binary |
| 44 | + path: . |
| 45 | + - name: Monitor |
| 46 | + uses: kalverra/octometrics-action@v0.0.10 |
| 47 | + with: |
| 48 | + job_name: Test |
| 49 | + version: ./octometrics-binary |
| 50 | + env: |
| 51 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + - name: Checkout code |
| 53 | + uses: actions/checkout@v6 |
| 54 | + - name: Setup Go |
| 55 | + uses: actions/setup-go@v6 |
| 56 | + with: |
| 57 | + go-version: stable |
| 58 | + - name: Install Dependencies |
| 59 | + run: go mod download |
| 60 | + - name: Run tests |
| 61 | + run: OCTOMETRICS_TEST_LOG_LEVEL=trace go tool gotestsum --junitfile junit.xml -- -coverprofile=cover.out ./... |
| 62 | + - name: Upload coverage reports to Codecov |
| 63 | + uses: codecov/codecov-action@v5 |
| 64 | + with: |
| 65 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 66 | + files: cover.out |
72 | 67 |
|
73 | | - test-race: |
74 | | - name: Test (Race) |
75 | | - needs: build |
76 | | - runs-on: ubuntu-latest |
77 | | - steps: |
78 | | - - name: Download Built Binary |
79 | | - uses: actions/download-artifact@v4 |
80 | | - with: |
81 | | - name: octometrics-binary |
82 | | - path: . |
83 | | - - name: Monitor |
84 | | - uses: kalverra/octometrics-action@v0.0.5 |
85 | | - with: |
86 | | - job_name: Test (Race) |
87 | | - version: ./octometrics-binary |
88 | | - env: |
89 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
90 | | - - name: Checkout code |
91 | | - uses: actions/checkout@v4 |
92 | | - - name: Setup Go |
93 | | - uses: actions/setup-go@v5 |
94 | | - with: |
95 | | - go-version: stable |
96 | | - - name: Install Dependencies |
97 | | - run: go mod download |
98 | | - - name: Run tests with race detector |
99 | | - run: OCTOMETRICS_TEST_LOG_LEVEL=trace go tool gotestsum -- -count=1 -cover -race ./... |
| 68 | + test-race: |
| 69 | + name: Test (Race) |
| 70 | + needs: build |
| 71 | + runs-on: ubuntu-latest |
| 72 | + steps: |
| 73 | + - name: Download Built Binary |
| 74 | + uses: actions/download-artifact@v8 |
| 75 | + with: |
| 76 | + name: octometrics-binary |
| 77 | + path: . |
| 78 | + - name: Monitor |
| 79 | + uses: kalverra/octometrics-action@v0.0.10 |
| 80 | + with: |
| 81 | + job_name: Test (Race) |
| 82 | + version: ./octometrics-binary |
| 83 | + env: |
| 84 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + - name: Checkout code |
| 86 | + uses: actions/checkout@v6 |
| 87 | + - name: Setup Go |
| 88 | + uses: actions/setup-go@v6 |
| 89 | + with: |
| 90 | + go-version: stable |
| 91 | + - name: Install Dependencies |
| 92 | + run: go mod download |
| 93 | + - name: Run tests with race detector |
| 94 | + run: OCTOMETRICS_TEST_LOG_LEVEL=trace go tool gotestsum -- -count=1 -cover -race ./... |
100 | 95 |
|
101 | | - lint: |
102 | | - name: Lint |
103 | | - needs: build |
104 | | - runs-on: ubuntu-latest |
105 | | - steps: |
106 | | - - name: Download Built Binary |
107 | | - uses: actions/download-artifact@v4 |
108 | | - with: |
109 | | - name: octometrics-binary |
110 | | - path: . |
111 | | - - name: Monitor |
112 | | - uses: kalverra/octometrics-action@v0.0.5 |
113 | | - with: |
114 | | - job_name: Lint |
115 | | - version: ./octometrics-binary |
116 | | - env: |
117 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
118 | | - - name: Checkout code |
119 | | - uses: actions/checkout@v4 |
120 | | - - name: Set up Go |
121 | | - uses: actions/setup-go@v5 |
122 | | - with: |
123 | | - go-version: stable |
124 | | - - name: Install Dependencies |
125 | | - run: go mod download |
126 | | - - name: golangci-lint |
127 | | - uses: golangci/golangci-lint-action@v7 |
128 | | - with: |
129 | | - version: v2.0 |
| 96 | + lint: |
| 97 | + name: Lint |
| 98 | + needs: build |
| 99 | + runs-on: ubuntu-latest |
| 100 | + steps: |
| 101 | + - name: Download Built Binary |
| 102 | + uses: actions/download-artifact@v8 |
| 103 | + with: |
| 104 | + name: octometrics-binary |
| 105 | + path: . |
| 106 | + - name: Monitor |
| 107 | + uses: kalverra/octometrics-action@v0.0.10 |
| 108 | + with: |
| 109 | + job_name: Lint |
| 110 | + version: ./octometrics-binary |
| 111 | + env: |
| 112 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 113 | + - name: Checkout code |
| 114 | + uses: actions/checkout@v6 |
| 115 | + - name: Set up Go |
| 116 | + uses: actions/setup-go@v6 |
| 117 | + with: |
| 118 | + go-version: stable |
| 119 | + - name: Install Dependencies |
| 120 | + run: go mod download |
| 121 | + |
| 122 | + - name: golangci-lint |
| 123 | + uses: golangci/golangci-lint-action@v9 |
| 124 | + with: |
| 125 | + version: latest |
0 commit comments