Skip to content

Commit

Permalink
cache only from test
Browse files Browse the repository at this point in the history
  • Loading branch information
candiduslynx committed Apr 4, 2023
1 parent d2badfe commit cd93e52
Showing 1 changed file with 7 additions and 40 deletions.
47 changes: 7 additions & 40 deletions .github/workflows/source_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ jobs:
go-version-file: plugins/source/aws/go.mod
cache: true
cache-dependency-path: plugins/source/aws/go.sum
- name: Restore build cache
uses: actions/cache/restore@v3
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-${{ hashFiles('plugins/source/aws/go.sum') }}
# no direct cache hit, however, even a partial hit might be beneficial
restore-keys: source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-
- name: Get dependencies
run: go get -t -d ./...
# Lint should run after deps, as the dependencies might introduce deprecation to used functions
Expand Down Expand Up @@ -100,15 +90,6 @@ jobs:
- name: Run sync
if: startsWith(github.head_ref, 'release-please--branches--main--components')
run: cloudquery sync test/sanity.yml --log-console
- name: Save build cache
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v3
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-${{ hashFiles('plugins/source/aws/go.sum') }}
validate-release:
timeout-minutes: 60
needs: [resolve-runner]
Expand All @@ -125,19 +106,16 @@ jobs:
uses: actions/setup-go@v3
with:
go-version-file: plugins/source/aws/go.mod
cache: true
cache-dependency-path: plugins/source/aws/go.sum
- name: Restore build cache
cache: false
- uses: actions/cache@v3
if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push'
uses: actions/cache/restore@v3
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-${{ hashFiles('plugins/source/aws/go.sum') }}
# no direct cache hit, however, even a partial hit might be beneficial
restore-keys: source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-
~/go/pkg/mod
key: release-cache-plugins-source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-${{ hashFiles('plugins/source/aws/go.sum') }}
restore-keys: |
release-cache-plugins-source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-
- name: Install GoReleaser
if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push'
uses: goreleaser/goreleaser-action@v3
Expand Down Expand Up @@ -180,18 +158,7 @@ jobs:
uses: actions/setup-go@v3
with:
go-version-file: plugins/source/aws/go.mod
cache: true
cache-dependency-path: plugins/source/aws/go.sum
- name: Restore build cache
uses: actions/cache/restore@v3
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-${{ hashFiles('plugins/source/aws/go.sum') }}
# no direct cache hit, however, even a partial hit might be beneficial
restore-keys: source-aws-${{ runner.os }}-go-${{ steps.set-up-go.outputs.go-version }}-
cache: false
- name: Build
run: go build .
- name: Setup CloudQuery
Expand Down

0 comments on commit cd93e52

Please sign in to comment.