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

[ci] Use native go GitHub action #6

Merged
merged 4 commits into from
Apr 30, 2024
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
17 changes: 17 additions & 0 deletions .github/actions/run-go-tests/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Go Unit Tests"
description: |
Run Go unit tests

runs:
using: composite
steps:
# Setup checkout of Git
- uses: actions/checkout@v3
# Setup Go
- uses: actions/setup-go@v5
with:
go-version: '>=1.22'
# Run unit tests
- shell: bash
run: 'go test ./...'

19 changes: 19 additions & 0 deletions .github/workflows/run-go-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
env:
GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

name: "Go Unit Tests"
on:
pull_request:
types: [ labeled, opened, synchronize, reopened, auto_merge_enabled ]
push:
branches:
- main

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GIT_SHA }}
- uses: ./.github/actions/run-go-tests
18 changes: 0 additions & 18 deletions .github/workflows/run-go-tests.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ go.work

# build product
cmd/goclient/goclient

.idea/
*.swp
*.swo
Loading