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

Go: miscellaneous CI improvements #139

Merged
Merged
Show file tree
Hide file tree
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
28 changes: 7 additions & 21 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Go CI

on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
Expand All @@ -23,7 +22,7 @@ concurrency:

jobs:
build-and-test-go-client:
timeout-minutes: 20
timeout-minutes: 35
strategy:
# Run all jobs
fail-fast: false
Expand Down Expand Up @@ -69,6 +68,10 @@ jobs:
working-directory: ./go
run: make install-tools-go${{ matrix.go }}

- name: Set LD_LIBRARY_PATH
if: ${{ matrix.os == 'ubuntu-latest' }}
run: echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/go/target/release/deps/" >> $GITHUB_ENV

- name: Build client
working-directory: ./go
run: make build
Expand All @@ -79,16 +82,7 @@ jobs:

- name: Run tests
working-directory: ./go
run: make test-and-report

- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-reports-go-${{ matrix.go }}-redis-${{ matrix.redis }}-${{ matrix.os }}
path: |
go/reports/test-report.html
run: make test

build-amazonlinux-latest:
if: github.repository_owner == 'aws'
Expand Down Expand Up @@ -154,15 +148,7 @@ jobs:

- name: Run tests
working-directory: ./go
run: make test-and-report

- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-reports-go-${{ matrix.go }}-amazon-linux-latest
path: go/reports/test-report.html
run: make test

lint-rust:
timeout-minutes: 15
Expand Down
13 changes: 4 additions & 9 deletions go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ install-tools-go1.22.0: install-build-tools install-dev-tools-go1.22.0

install-tools: install-tools-go1.22.0

build: build-glide-core build-glide-client generate-protobuf
build: build-glide-client generate-protobuf
go build ./...

build-glide-core:
cd ../glide-core; cargo build --release

build-glide-client:
cargo build --release

Expand All @@ -46,9 +43,7 @@ lint:
gofumpt -d .
golines --dry-run --shorten-comments -m 127 .

lint-ci:
go vet ./...
staticcheck ./...
lint-ci: lint
if [ "$$(gofumpt -l . | wc -l)" -gt 0 ]; then exit 1; fi
if [ "$$(golines -l --shorten-comments -m 127 . | wc -l)" -gt 0 ]; then exit 1; fi

Expand All @@ -57,8 +52,8 @@ format:
golines -w --shorten-comments -m 127 .

test:
go test -v -race `go list ./... | grep -v protobuf`
go test -v -race ./...

test-and-report:
mkdir -p reports
go test -v -race `go list ./... | grep -v protobuf` -json | go-test-report -o reports/test-report.html
go test -v -race ./... -json | go-test-report -o reports/test-report.html
Loading