cache go mod in linter action (#367)
This commit is contained in:
parent
1a31a07425
commit
a823231afd
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@ -27,13 +27,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.18
|
||||||
|
|
||||||
- name: Cache Go build
|
# download packages
|
||||||
uses: actions/cache@v3
|
|
||||||
id: mybuild
|
|
||||||
with:
|
|
||||||
path: ~/.cache/go-build
|
|
||||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
|
||||||
|
|
||||||
- name: Cache Go Mod
|
- name: Cache Go Mod
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
id: cache
|
id: cache
|
||||||
@ -45,19 +39,30 @@ jobs:
|
|||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: go mod download
|
run: go mod download
|
||||||
|
|
||||||
|
# build the binary
|
||||||
|
- name: Cache Go build
|
||||||
|
uses: actions/cache@v3
|
||||||
|
id: mybuild
|
||||||
|
with:
|
||||||
|
path: ~/.cache/go-build
|
||||||
|
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
||||||
|
|
||||||
- name: Go build
|
- name: Go build
|
||||||
if: steps.mybuild.outputs.cache-hit != 'true'
|
if: steps.mybuild.outputs.cache-hit != 'true'
|
||||||
run: go build ./...
|
run: go build ./...
|
||||||
|
|
||||||
|
# check licenses
|
||||||
- name: Get go-licenses
|
- name: Get go-licenses
|
||||||
run: go install github.com/google/go-licenses@latest
|
run: go install github.com/google/go-licenses@latest
|
||||||
|
|
||||||
- name: Run go-licenses
|
- name: Run go-licenses
|
||||||
run: go-licenses check github.com/alcionai/corso --ignore github.com/alcionai/corso
|
run: go-licenses check github.com/alcionai/corso --ignore github.com/alcionai/corso
|
||||||
|
|
||||||
|
# gofmt
|
||||||
- name: Run gofmt
|
- name: Run gofmt
|
||||||
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
|
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
|
||||||
|
|
||||||
|
# AWS creds
|
||||||
- name: Configure AWS credentials from Test account
|
- name: Configure AWS credentials from Test account
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
@ -65,6 +70,7 @@ jobs:
|
|||||||
role-session-name: integration-testing
|
role-session-name: integration-testing
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
|
|
||||||
|
# run the tests
|
||||||
- run: echo "Running ${{ github.repository }} deployment unit tests at ${{ env.TIME_OF_TEST }}."
|
- run: echo "Running ${{ github.repository }} deployment unit tests at ${{ env.TIME_OF_TEST }}."
|
||||||
- name: Deployment Tests
|
- name: Deployment Tests
|
||||||
env:
|
env:
|
||||||
|
|||||||
16
.github/workflows/lint.yml
vendored
16
.github/workflows/lint.yml
vendored
@ -21,24 +21,24 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.18
|
||||||
|
|
||||||
- name: Cache Go build
|
|
||||||
uses: actions/cache@v3
|
|
||||||
id: mybuild
|
|
||||||
with:
|
|
||||||
path: ~/.cache/go-build
|
|
||||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum')}}
|
|
||||||
|
|
||||||
- name: Cache Go Mod
|
- name: Cache Go Mod
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
path: ~/go/pkg/mod
|
||||||
key: ${{ runner.os }}-go-mod${{ hashFiles('**/go.sum')}}
|
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
||||||
|
|
||||||
- name: Download package dependencies
|
- name: Download package dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: go mod download
|
run: go mod download
|
||||||
|
|
||||||
|
- name: Cache Go build
|
||||||
|
uses: actions/cache@v3
|
||||||
|
id: mybuild
|
||||||
|
with:
|
||||||
|
path: ~/.cache/go-build
|
||||||
|
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
||||||
|
|
||||||
- name: Build for Lint
|
- name: Build for Lint
|
||||||
if: steps.mybuild.outputs.cache-hit != 'true'
|
if: steps.mybuild.outputs.cache-hit != 'true'
|
||||||
run: go build ./...
|
run: go build ./...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user