Skip to content

Commit

Permalink
Repository upkeep (#361)
Browse files Browse the repository at this point in the history
* Added github action to Build and Test the repository

* Removed the comment

* Adding github actions for build and test on every push to the master branch

* Corrected the go list command

* Renamed the build and test file

---------

Co-authored-by: Gaurav Kumar <gauravk@uber.com>
  • Loading branch information
gkeesh7 and gauravkuber committed Sep 23, 2024
1 parent fd35b87 commit 0e18de0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Test

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.21', '1.22' , '1.23' ]
steps:
- uses: actions/checkout@v4
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version
- name: Install dependencies
run: go mod download
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test $(go list ./...) -cover -json > TestResults-${{ matrix.go-version }}.json
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
name: Go-results-${{ matrix.go-version }}
path: TestResults-${{ matrix.go-version }}.json

0 comments on commit 0e18de0

Please sign in to comment.