+Magefile.go
Ожидается выполнение проверок
test / test (1.16.x) (push) Waiting to run
test / test (1.17.x) (push) Waiting to run
test / test (oldstable) (push) Waiting to run
test / test (stable) (push) Waiting to run
Ожидается выполнение проверок
test / test (1.16.x) (push) Waiting to run
test / test (1.17.x) (push) Waiting to run
test / test (oldstable) (push) Waiting to run
test / test (stable) (push) Waiting to run
Этот коммит содержится в:
родитель
ccc4a42649
коммит
f5ec4cadce
1 изменённых файлов: 138 добавлений и 0 удалений
138
Magefile.go
Обычный файл
138
Magefile.go
Обычный файл
|
@ -0,0 +1,138 @@
|
|||
//go:build mage
|
||||
// +build mage
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
// mage:import
|
||||
. "magefile/docker"
|
||||
)
|
||||
|
||||
var (
|
||||
GolangVolume = "golang.upstream"
|
||||
)
|
||||
|
||||
func init() {
|
||||
AppName = "godog"
|
||||
ImageName = "my/go"
|
||||
}
|
||||
|
||||
func Test() {
|
||||
TestNative()
|
||||
}
|
||||
func TestNative() {
|
||||
Bash(`sudo docker run -ti --rm \
|
||||
-h host \
|
||||
--net=bridge \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-v ` + GolangVolume + `:/usr/local/go:ro \
|
||||
\
|
||||
-v /gopath:/gopath:rw \
|
||||
-v ${PWD}:/app \
|
||||
\
|
||||
-e GOPATH=/gopath \
|
||||
-e GOCACHE=/gopath/gocache \
|
||||
\
|
||||
-w /app \
|
||||
-u 1000 \
|
||||
\
|
||||
--entrypoint=/bin/bash \
|
||||
\
|
||||
` + ImageName + " -c '" + `\
|
||||
go test -race -count=1 ./... \
|
||||
'`)
|
||||
}
|
||||
|
||||
func TestMakefile() {
|
||||
Bash(`sudo docker run -ti --rm \
|
||||
-h host \
|
||||
--net=bridge \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-v ` + GolangVolume + `:/usr/local/go:ro \
|
||||
\
|
||||
-v /gopath:/gopath:rw \
|
||||
-v ${PWD}:/app \
|
||||
\
|
||||
-e GOPATH=/gopath \
|
||||
-e GOCACHE=/gopath/gocache \
|
||||
\
|
||||
-w /app \
|
||||
-u 1000 \
|
||||
\
|
||||
--entrypoint=/bin/bash \
|
||||
\
|
||||
` + ImageName + " -c '" + `set -x; \
|
||||
make test \
|
||||
'`)
|
||||
}
|
||||
|
||||
func TestSnippets() {
|
||||
Bash(`sudo docker run -ti --rm \
|
||||
-h host \
|
||||
--net=bridge \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-v ` + GolangVolume + `:/usr/local/go:ro \
|
||||
\
|
||||
-v /gopath:/gopath:rw \
|
||||
-v ${PWD}:/app \
|
||||
\
|
||||
-e GOPATH=/gopath \
|
||||
-e GOCACHE=/gopath/gocache \
|
||||
\
|
||||
-w /app \
|
||||
-u 1000 \
|
||||
\
|
||||
--entrypoint=/bin/bash \
|
||||
\
|
||||
` + ImageName + " -c '" + `set -x; \
|
||||
godog run -f progress -c 4 \
|
||||
features/snippets.feature \
|
||||
'`)
|
||||
}
|
||||
|
||||
func TestTags() {
|
||||
Bash(`sudo docker run -ti --rm \
|
||||
-h host \
|
||||
--net=bridge \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-v ` + GolangVolume + `:/usr/local/go:ro \
|
||||
\
|
||||
-v /gopath:/gopath:rw \
|
||||
-v ${PWD}:/app \
|
||||
\
|
||||
-e GOPATH=/gopath \
|
||||
-e GOCACHE=/gopath/gocache \
|
||||
\
|
||||
-w /app \
|
||||
-u 1000 \
|
||||
\
|
||||
--entrypoint=/bin/bash \
|
||||
\
|
||||
` + ImageName + " -c '" + `set -x; \
|
||||
godog run -f progress -c 4 \
|
||||
features/tags.feature \
|
||||
'`)
|
||||
}
|
||||
|
||||
func Install() {
|
||||
Bash(`sudo docker run -ti --rm \
|
||||
-h host \
|
||||
--net=bridge \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-v ` + GolangVolume + `:/usr/local/go:ro \
|
||||
\
|
||||
-v /gopath:/gopath:rw \
|
||||
-v ${PWD}:/app \
|
||||
\
|
||||
-e GOPATH=/gopath \
|
||||
-e GOCACHE=/gopath/gocache \
|
||||
\
|
||||
-w /app \
|
||||
-u 1000 \
|
||||
\
|
||||
--entrypoint=/bin/bash \
|
||||
\
|
||||
` + ImageName + " -c '" + `set -x; \
|
||||
go install ./cmd/godog \
|
||||
'`)
|
||||
}
|
Загрузка…
Создание таблицы
Сослаться в новой задаче