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

[UPDATE] build actions #13

Merged
merged 3 commits into from
Aug 27, 2024
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
50 changes: 21 additions & 29 deletions .github/workflows/build-go.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,37 @@
name: GO

on:
pull_request:
branches:
- 'master'
push:
tags:
- 'v*'
branches:
- 'master'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.23.0]
runs-on: ubuntu-latest
go-version: [ '1.23' ]
services:
redis:
image: redis:latest
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- name: Set up Go
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build
- name: Run Tests
run: go test

release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.23.0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
- name: Install dependencies
run: go get .
- name: Test with Go
run: go test
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
version: v1.9.2
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CGO_ENABLED: 0
name: Go-results-${{ matrix.go-version }}
path: TestResults-${{ matrix.go-version }}.json
Loading