Skip to content

Adding github actions workflows #2

Adding github actions workflows

Adding github actions workflows #2

Workflow file for this run

name: Run tests and upload results
on:
push:
branches:
- main
- develop
paths:
- cmd/**
- internal/**
- .dockerignore
- .golangci.yml
- go.mod
- go.sum
pull_request:
branches:
- main
- develop
paths:
- cmd/**
- internal/**
- .dockerignore
- .golangci.yml
- go.mod
- go.sum
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.19", "1.20", "1.21.x"]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54
- name: Install dependencies
run: go get .
- name: Test with Go
run: go test ./... -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