Skip to content

Commit

Permalink
Fix more cache keys, and output checks. Merge tools and mod in all wo…
Browse files Browse the repository at this point in the history
…rkflows (#9948)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu authored May 11, 2022
1 parent 1415386 commit 7be94a5
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 80 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
uses: actions/cache@v3
with:
path: |
\Users\runneradmin\go\pkg\mod
%LocalAppData%\go-build
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
~\go\pkg\mod
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Run Unit tests
# use default Go build tags from Makefile.common
run: go test --tags containers_image_openpgp,exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper ./...
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.hit != 'true'
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.go-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -63,13 +63,13 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Cache Lint Build
uses: actions/cache@v3
with:
path: /home/runner/.cache/go-build
path: ~/.cache/go-build
key: go-lint-build-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Lint
run: make -j2 golint
Expand All @@ -92,8 +92,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: CheckDoc
run: make checkdoc
Expand Down Expand Up @@ -133,13 +133,13 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Cache Test Build
uses: actions/cache@v3
with:
path: /home/runner/.cache/go-build
path: ~/.cache/go-build
key: go-test-build-${{ runner.os }}-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Run Unit Tests
run: make gotest
Expand All @@ -162,8 +162,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Run Integration Tests
run: make integration-tests-with-cover
Expand All @@ -187,8 +187,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Correctness
run: make -C testbed run-correctness-traces-tests
Expand All @@ -211,8 +211,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Correctness
run: make -C testbed run-correctness-metrics-tests
Expand Down Expand Up @@ -253,8 +253,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Build Collector ${{ matrix.binary }}
run: make otelcontribcol-${{ matrix.binary }}
Expand Down Expand Up @@ -382,8 +382,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Download Binaries
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -443,8 +443,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Set Release Tag
id: github_tag
Expand Down
30 changes: 12 additions & 18 deletions .github/workflows/load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,19 @@ jobs:
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: module-cache
id: go-cache
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: loadtest-go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: loadtest-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install Dependencies
if: steps.module-cache.outputs.hit != 'true'
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.module-cache.outputs.hit != 'true'
if: steps.go-cache.outputs.cache-hit != 'true'
run: make install-tools
- run: make otelcontribcol-testbed
- name: Upload Collector Binaries
Expand All @@ -62,8 +60,6 @@ jobs:
- name: Fluentbit Cache
id: fluentbit-cache
uses: actions/cache@v3
env:
cache-name: cache-fluentbit
with:
path: /opt/td-agent-bit
key: fluentbit-cache-1.5.3
Expand All @@ -82,16 +78,14 @@ jobs:
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: module-cache
id: go-cache
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: |
/home/runner/go/bin
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: loadtest-go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: loadtest-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- run: mkdir -p results && touch results/TESTRESULTS.md
- name: Download Collector Binaries
uses: actions/download-artifact@v3
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/prometheus-compliance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
env:
cache-name: cache-tool-binaries
with:
path: /home/runner/go/bin
key: v1-tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- name: Setup Go
uses: actions/setup-go@v3
with:
Expand All @@ -29,15 +21,14 @@ jobs:
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: module-cache
id: go-cache
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: prometheus-${{ runner.os }}-go-${{ hashFiles('**/go.mod', '**/go.sum') }}
- run: make otelcontribcol
- name: Checkout compliance repo
uses: actions/checkout@v3
Expand Down
34 changes: 12 additions & 22 deletions .github/workflows/stability-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,19 @@ jobs:
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: module-cache
id: go-cache
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
env:
cache-name: cache-tool-binaries
with:
path: /home/runner/go/bin
key: v1-tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: stability-${{ runner.os }}-go-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Install dependencies
if: steps.module-cache.outputs.hit != 'true'
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.tool-cache.outputs.cache-hit != 'true'
if: steps.go-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Split Stability Jobs
id: splitstabilitytest
Expand All @@ -69,15 +60,14 @@ jobs:
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: module-cache
id: go-cache
uses: actions/cache@v3
env:
cache-name: cache-go-modules
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: stability-${{ runner.os }}-go-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Run Stability Tests
run: make stability-tests
env:
Expand Down

0 comments on commit 7be94a5

Please sign in to comment.