|
57 | 57 | - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 |
58 | 58 | with: |
59 | 59 | go-version-file: 'go.mod' |
| 60 | + - name: Set Start Time |
| 61 | + run: echo "START_TIME=$(date +"%Y-%m-%dT%H:%M:%S.%NZ")" >> ${GITHUB_ENV} |
| 62 | + - name: Create Directory |
| 63 | + run: mkdir -p ${{github.workspace}}/test/dashboard/logs/${{github.job}}/ |
| 64 | + - name: Start Promtail |
| 65 | + uses: ./.github/actions/start-promtail |
| 66 | + with: |
| 67 | + loki-dashboard-url: ${{ secrets.LOKI_DASHBOARD_URL }} |
60 | 68 | - name: Run Unit Tests |
61 | | - run: make unit-test |
| 69 | + run: make unit-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/raw_logs.log && exit "${PIPESTATUS[0]}" |
| 70 | + - name: Generate Test Results |
| 71 | + if: always() |
| 72 | + run: bash ./scripts/workflow/generate_results.sh ${{job.status}} ${{env.START_TIME}} ${{github.job}} ${{github.workspace}} |
62 | 73 | - name: Upload Test Coverage |
63 | 74 | uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0 |
64 | 75 | with: |
@@ -161,18 +172,29 @@ jobs: |
161 | 172 | with: |
162 | 173 | name: nginx-agent-unsigned-snapshots |
163 | 174 | path: build |
| 175 | + - name: Set Start Time |
| 176 | + run: echo "START_TIME=$(date +"%Y-%m-%dT%H:%M:%S.%NZ")" >> ${GITHUB_ENV} |
| 177 | + - name: Create Directory |
| 178 | + run: mkdir -p ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/ |
| 179 | + - name: Start Promtail |
| 180 | + uses: ./.github/actions/start-promtail |
| 181 | + with: |
| 182 | + loki-dashboard-url: ${{ secrets.LOKI_DASHBOARD_URL }} |
164 | 183 | - name: Run Integration Tests |
165 | 184 | run: | |
166 | 185 | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} |
167 | 186 | OS_RELEASE="${{ matrix.container.image }}" OS_VERSION="${{ matrix.container.version }}" \ |
168 | | - make integration-test |
| 187 | + make integration-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/raw_logs.log && exit "${PIPESTATUS[0]}" |
| 188 | + - name: Generate Test Results |
| 189 | + if: always() |
| 190 | + run: bash ./scripts/workflow/generate_results.sh ${{job.status}} ${{env.START_TIME}} ${{github.job}}/${{matrix.container.image}}${{matrix.container.version}} ${{github.workspace}} |
169 | 191 | - name: Container Output Logs |
170 | 192 | if: failure() |
171 | 193 | run: | |
172 | 194 | docker ps -a |
173 | 195 | dockerid=$(docker ps -a --format "{{.ID}}") |
174 | 196 | docker logs "$dockerid" |
175 | | -
|
| 197 | + |
176 | 198 | - name: Archive integration test logs |
177 | 199 | if: success() || failure() |
178 | 200 | uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 |
@@ -214,11 +236,22 @@ jobs: |
214 | 236 | with: |
215 | 237 | name: nginx-agent-unsigned-snapshots |
216 | 238 | path: build |
| 239 | + - name: Set Start Time |
| 240 | + run: echo "START_TIME=$(date +"%Y-%m-%dT%H:%M:%S.%NZ")" >> ${GITHUB_ENV} |
| 241 | + - name: Create Directory |
| 242 | + run: mkdir -p ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/ |
| 243 | + - name: Start Promtail |
| 244 | + uses: ./.github/actions/start-promtail |
| 245 | + with: |
| 246 | + loki-dashboard-url: ${{ secrets.LOKI_DASHBOARD_URL }} |
217 | 247 | - name: Run Integration Tests |
218 | 248 | run: | |
219 | 249 | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} |
220 | 250 | CONTAINER_NGINX_IMAGE_REGISTRY="${{ env.NGINX_OSS_REGISTRY }}" TAG="${{ matrix.container.version }}-${{ matrix.container.image }}" OS_RELEASE="${{ matrix.container.release }}"\ |
221 | | - make official-image-integration-test |
| 251 | + make official-image-integration-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/raw_logs.log && exit "${PIPESTATUS[0]}" |
| 252 | + - name: Generate Test Results |
| 253 | + if: always() |
| 254 | + run: bash ./scripts/workflow/generate_results.sh ${{job.status}} ${{env.START_TIME}} ${{github.job}}/${{matrix.container.image}}${{matrix.container.version}} ${{github.workspace}} |
222 | 255 | - name: Container Output Logs |
223 | 256 | if: failure() |
224 | 257 | run: | |
@@ -281,12 +314,23 @@ jobs: |
281 | 314 | registry: ${{ secrets.REGISTRY_URL }} |
282 | 315 | username: ${{ secrets.REGISTRY_USERNAME }} |
283 | 316 | password: ${{ secrets.REGISTRY_PASSWORD }} |
| 317 | + - name: Set Start Time |
| 318 | + run: echo "START_TIME=$(date +"%Y-%m-%dT%H:%M:%S.%NZ")" >> ${GITHUB_ENV} |
| 319 | + - name: Create Directory |
| 320 | + run: mkdir -p ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/ |
| 321 | + - name: Start Promtail |
| 322 | + uses: ./.github/actions/start-promtail |
| 323 | + with: |
| 324 | + loki-dashboard-url: ${{ secrets.LOKI_DASHBOARD_URL }} |
284 | 325 | - name: Run Integration Tests |
285 | 326 | run: | |
286 | 327 | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} |
287 | 328 | CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \ |
288 | 329 | OS_RELEASE="${{ matrix.container.release }}" IMAGE_PATH="${{ matrix.container.path }}" \ |
289 | | - make official-image-integration-test |
| 330 | + make official-image-integration-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/raw_logs.log && exit "${PIPESTATUS[0]}" |
| 331 | + - name: Generate Test Results |
| 332 | + if: always() |
| 333 | + run: bash ./scripts/workflow/generate_results.sh ${{job.status}} ${{env.START_TIME}} ${{github.job}}/${{matrix.container.image}}${{matrix.container.version}} ${{github.workspace}} |
290 | 334 | - name: Container Output Logs |
291 | 335 | if: failure() |
292 | 336 | run: | |
|
0 commit comments