-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da62bbb
commit bcd0cd6
Showing
8 changed files
with
124 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: CI Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: luthersystems/build-go:v0.0.68 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Run CI | ||
run: make citest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
PROJECT_REL_DIR=./ | ||
include ${PROJECT_REL_DIR}/common.mk | ||
DOCKER_PROJECT_DIR:=$(call DOCKER_DIR, ${PROJECT_REL_DIR}) | ||
|
||
.PHONY: default | ||
default: all | ||
|
||
.PHONY: all | ||
|
||
.PHONY: static-checks | ||
static-checks: | ||
./scripts/static-checks.sh | ||
|
||
.PHONY: go-test | ||
go-test: | ||
${GO_TEST_TIMEOUT_10} ./... | ||
|
||
.PHONY: citest | ||
citest: static-checks go-test | ||
@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
PROJECT=pushproxng | ||
PROJECT_PATH=github.com/luthersystems/${PROJECT} | ||
|
||
BUILDENV_TAG=v0.0.69 | ||
BUILD_IMAGE_GO=luthersystems/build-go:${BUILDENV_TAG} | ||
|
||
TAG_SUFFIX ?= -amd64 | ||
GIT_TAG ?= $(shell git describe --tags --exact-match 2>/dev/null) | ||
GIT_REVISION ?= $(shell git rev-parse --short HEAD) | ||
VERSION ?= $(if $(strip $(GIT_TAG)),$(GIT_TAG),$(GIT_REVISION)) | ||
BUILD_VERSION ?= ${VERSION}${TAG_SUFFIX} | ||
|
||
GO_PKG_VOLUME=${PROJECT}-build-gopath-pkg | ||
GO_PKG_PATH=/go/pkg | ||
GO_PKG_MOUNT=$(if $(CI),-v $(PWD)/build/pkg:${GO_PKG_PATH},--mount='type=volume,source=${GO_PKG_VOLUME},destination=${GO_PKG_PATH}') | ||
|
||
GO_TEST_BASE=go test ${GO_TEST_FLAGS} | ||
GO_TEST_TIMEOUT_10=${GO_TEST_BASE} -timeout 10m | ||
|
||
DOCKER_IN_DOCKER_MOUNT?=-v /var/run/docker.sock:/var/run/docker.sock | ||
|
||
ifeq ($(OS),Windows_NT) | ||
IS_WINDOWS=1 | ||
endif | ||
|
||
CP=cp | ||
RM=rm | ||
DOCKER=docker | ||
DOCKER_SSH_OPTS?=$(shell pinata-ssh-mount || echo "-v $$SSH_AUTH_SOCK:/ssh-agent -v $$HOME/.ssh/known_hosts:/root/.ssh/known_hosts -e SSH_AUTH_SOCK=/ssh-agent") | ||
DOCKER_RUN_OPTS=--rm | ||
DOCKER_RUN=${DOCKER} run ${DOCKER_RUN_OPTS} | ||
CHOWN=$(if $(CIRCLECI),sudo chown,chown) | ||
CHOWN_USR=$(shell id -u) | ||
DOCKER_USER=$(shell id -u):$(shell id -g) | ||
CHOWN_GRP=$(if $(or $(IS_WINDOWS),$(CIRCLECI)),,$(shell id -g)) | ||
DOMAKE=cd $1 && $(MAKE) $2 # NOTE: this is not used for now as it does not work with -j for some versions of Make | ||
MKDIR_P=mkdir -p | ||
TOUCH=touch | ||
GZIP=gzip | ||
GUNZIP=gunzip | ||
TIME_P=time -p | ||
TAR=tar | ||
|
||
# The Makefile determines whether to build a container or not by consulting a | ||
# dummy file that is touched whenever the container is built. The function, | ||
# IMAGE_DUMMY, computes the path to the dummy file. | ||
DUMMY_TARGET=build/$(1)/$(2)/.dummy | ||
IMAGE_DUMMY=$(call DUMMY_TARGET,image,$(1)) | ||
PUSH_DUMMY=$(call DUMMY_TARGET,push,$(1)) | ||
MANIFEST_DUMMY=$(call DUMMY_TARGET,manifest,$(1)) | ||
FQ_DOCKER_IMAGE ?= docker.io/$(1) | ||
|
||
UNAME := $(shell uname) | ||
GIT_LS_FILES=$(shell git ls-files $(1)) | ||
|
||
DOCKER_WIN_DIR=$(shell cygpath -wm $(realpath $(1))) | ||
DOCKER_NIX_DIR=$(realpath $(1)) | ||
DOCKER_DIR=$(if $(IS_WINDOWS),$(call DOCKER_WIN_DIR, $(1)),$(call DOCKER_NIX_DIR, $(1))) | ||
|
||
# print out make variables, e.g.: | ||
# make echo:VERSION | ||
echo\:%: | ||
@echo $($*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
# Copyright © 2021 Luther Systems, Ltd. All right reserved. | ||
|
||
# This script runs source code checking tools it can be called via a make | ||
# target or can be run automatically during CI testing. | ||
|
||
set -exuo pipefail | ||
|
||
golangci-lint run --timeout=5m -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters