Skip to content

Commit

Permalink
[CI] Reduce cache download timeout (open-telemetry#14689)
Browse files Browse the repository at this point in the history
To fail earlier in when actions/cache job is stuck
  • Loading branch information
dmitryax authored Oct 3, 2022
1 parent a8827f6 commit 7429ab6
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
path: |
~\go\pkg\mod
key: go-mod-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-mod-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand Down Expand Up @@ -70,12 +72,16 @@ jobs:
path: |
~\go\pkg\mod
key: go-mod-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Cache Go Build
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
key: go-build-cache-${{ runner.os }}-${{ matrix.group }}-go-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Run Unit tests
run: make gotest GROUP=${{ matrix.group }}
windows-unittest:
Expand Down
42 changes: 34 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: build-and-test
on:
push:
branches: [ main ]
branches: [main]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
Expand Down Expand Up @@ -35,6 +35,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand Down Expand Up @@ -87,6 +89,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand All @@ -98,6 +102,8 @@ jobs:
with:
path: ~/.cache/go-build
key: go-lint-build-${{ matrix.group }}-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Lint
run: make -j2 golint GROUP=${{ matrix.group }}
lint:
Expand Down Expand Up @@ -134,6 +140,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand Down Expand Up @@ -188,6 +196,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand All @@ -199,6 +209,8 @@ jobs:
with:
path: ~/.cache/go-build
key: go-test-build-${{ runner.os }}-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Run Unit Tests
run: make gotest GROUP=${{ matrix.group }}
unittest:
Expand Down Expand Up @@ -239,6 +251,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Run Integration Tests
run: make integration-tests-with-cover

Expand All @@ -260,6 +274,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand All @@ -286,6 +302,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand Down Expand Up @@ -347,6 +365,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand Down Expand Up @@ -427,6 +447,8 @@ jobs:
path: |
"C:\Program Files (x86)\WiX Toolset v3.11"
key: wix-3.11
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install Wix Toolset
if: steps.wix-cache.outputs.cache-hit != 'true'
run: .\internal\buildscripts\packaging\msi\make.ps1 Install-Tools
Expand Down Expand Up @@ -483,6 +505,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand All @@ -508,14 +532,14 @@ jobs:
- name: Build Docker Image
if: steps.check.outputs.passed == 'true'
run: |
make docker-otelcontribcol
docker tag otelcontribcol:latest otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA
docker tag otelcontribcol:latest otel/opentelemetry-collector-contrib-dev:latest
make docker-otelcontribcol
docker tag otelcontribcol:latest otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA
docker tag otelcontribcol:latest otel/opentelemetry-collector-contrib-dev:latest
- name: Validate Docker Image
if: steps.check.outputs.passed == 'true'
run: |
docker run otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA --version
docker run otel/opentelemetry-collector-contrib-dev:latest --version
docker run otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA --version
docker run otel/opentelemetry-collector-contrib-dev:latest --version
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -524,8 +548,8 @@ jobs:
- name: Push Docker Image
if: steps.check.outputs.passed == 'true'
run: |
docker push otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA
docker push otel/opentelemetry-collector-contrib-dev:latest
docker push otel/opentelemetry-collector-contrib-dev:$GITHUB_SHA
docker push otel/opentelemetry-collector-contrib-dev:latest
publish-stable:
runs-on: ubuntu-latest
needs: [lint, unittest, integration-tests, build-package]
Expand All @@ -548,6 +572,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
~/go/bin
~/go/pkg/mod
key: changelog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"

- name: Ensure no changes to the CHANGELOG
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
~/go/pkg/mod
~/.cache/go-build
key: loadtest-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install Dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand Down Expand Up @@ -70,6 +72,8 @@ jobs:
with:
path: /opt/td-agent-bit
key: fluentbit-cache-1.5.3
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- run: sudo ln -s /opt/td-agent-bit/bin/td-agent-bit /usr/local/bin/fluent-bit
- name: Install fluentbit
if: steps.fluentbit-cache.outputs.cache-hit != 'true'
Expand All @@ -89,6 +93,8 @@ jobs:
~/go/pkg/mod
~/.cache/go-build
key: loadtest-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- name: Install Dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prometheus-compliance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
~/go/pkg/mod
~/.cache/go-build
key: prometheus-${{ runner.os }}-go-${{ hashFiles('**/go.mod', '**/go.sum') }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "10"
- run: make otelcontribcol
working-directory: opentelemetry-collector-contrib
- name: Checkout compliance repo
Expand Down

0 comments on commit 7429ab6

Please sign in to comment.