Merge pull request #9 from ionutbalutoiu/add-go-tests-github-workflow
Add go tests GitHub workflow
This commit is contained in:
commit
2ccfbc480b
3 changed files with 38 additions and 2 deletions
27
.github/workflows/go-tests.yml
vendored
Normal file
27
.github/workflows/go-tests.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: Go Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
go-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Golang
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- run: go version
|
||||
|
||||
- name: Run GARM Go Tests
|
||||
run: make test
|
||||
11
Makefile
11
Makefile
|
|
@ -1,14 +1,21 @@
|
|||
SHELL := bash
|
||||
|
||||
.PHONY : build-static
|
||||
|
||||
IMAGE_TAG = garm-build
|
||||
|
||||
USER_ID=$(shell ((docker --version | grep -q podman) && echo "0" || id -u))
|
||||
USER_GROUP=$(shell ((docker --version | grep -q podman) && echo "0" || id -g))
|
||||
|
||||
GO_PACKAGES?=$(shell (go list ./... | grep -v 'vendor'))
|
||||
|
||||
default: build-static
|
||||
|
||||
.PHONY : build-static
|
||||
build-static:
|
||||
@echo Building garm
|
||||
docker build --tag $(IMAGE_TAG) .
|
||||
docker run --rm -e USER_ID=$(USER_ID) -e USER_GROUP=$(USER_GROUP) -v $(PWD):/build/garm:z $(IMAGE_TAG) /build-static.sh
|
||||
@echo Binaries are available in $(PWD)/bin
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test $(GO_PACKAGES) -v $(TEST_ARGS) -timeout=15m -parallel=4
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
# GitHub Actions Runners Manager (garm)
|
||||
|
||||

|
||||
|
||||
Welcome to garm!
|
||||
|
||||
Garm enables you to create and automatically maintain pools of [self-hosted GitHub runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners), with autoscaling that can be used inside your github workflow runs.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue