Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ci): bump actions and remove explicit cache steps #30

Merged
merged 1 commit into from
Sep 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 19 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v2
id: go
- uses: actions/checkout@v3
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -42,29 +43,17 @@ jobs:
name: Go Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v2
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/setup-go@v4
with:
# Cache
path: ~/go/pkg/mod
# Cache key
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
go-version-file: go.mod
- name: Download dependencies
run: |
go get -v -t -d ./...
go mod download
- name: Go Test
run: |
go mod vendor && go test ./... -gcflags=-l -coverprofile=coverage.txt -covermode=atomic
go test ./... -gcflags=-l -coverprofile=coverage.txt -covermode=atomic
- name: "Upload test result"
if: always()
uses: actions/upload-artifact@v3
Expand All @@ -78,12 +67,11 @@ jobs:
name: License Check - Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v2
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Check License Header
uses: apache/skywalking-eyes/header@main
Expand All @@ -92,24 +80,14 @@ jobs:
name: Go fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v2
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/setup-go@v4
with:
# Cache
path: ~/go/pkg/mod
# Cache key
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
go-version-file: go.mod
- name: Download dependencies
run: |
go get -v -t -d ./...
go mod download
- name: Go Fmt
run: |
go fmt ./... && git status && [[ -z `git status -s` ]]
Expand Down
Loading