Skip to content
Snippets Groups Projects
Commit 55d6bb88 authored by Niamh Nikali's avatar Niamh Nikali
Browse files

Merge branch 'niamh/pipeline' into 'release'

Remove go steps from pipeline

See merge request elixxir/gpumathsnative!36
parents 670de031 89ee260f
Branches
No related tags found
No related merge requests found
......@@ -8,15 +8,10 @@ cache:
variables:
REPO_DIR: gitlab.com/elixxir
REPO_NAME: gpumaths
REPO_NAME: gpumathsnative
DOCKER_IMAGE: elixxirlabs/cuda-go:latest
MIN_CODE_COVERAGE: "20.0"
before_script:
##
## Go Setup
##
- go version || echo "Go executable not found."
- echo $CI_BUILD_REF
- echo $CI_PROJECT_DIR
- echo $PWD
......@@ -27,15 +22,9 @@ before_script:
- chmod 700 ~/.ssh
- ssh-keyscan -t rsa gitlab.com > ~/.ssh/known_hosts
- git config --global url."git@gitlab.com:".insteadOf "https://gitlab.com/"
- export GOFLAGS=-mod=vendor
- export PATH=$HOME/go/bin:$PATH
- export GOPRIVATE=gitlab.com/elixxir/*
stages:
- setup
- test
- build
- tag
- trigger_server
- trigger_release_server
......@@ -45,63 +34,13 @@ setup:
except:
- tags
script:
- go mod vendor -v
- go build ./...
- go mod tidy
- cd cgbnBindings/powm
- make turing
- make devinstall
artifacts:
paths:
- vendor/
- lib/
test:
stage: test
image: $DOCKER_IMAGE
tags:
- gpu
except:
- tags
script:
- mkdir -p /opt/xxnetwork/lib/
- mkdir -p /opt/xxnetwork/include
- cat /usr/local/cuda/version.txt
- nvidia-smi
- apt-get update
- apt-get install bc -y
- mkdir -p testdata
# Test coverage
- go test -v -tags gpu -coverprofile=testdata/coverage.out -covermode atomic -coverpkg ./... -race ./...
# Is it possible to correctly merge the coverage data between these two build tags?
# (Or simply ignore coverage for non-CUDA dummy code paths)
- go test -v -coverprofile=testdata/coverage-noncuda.out -covermode atomic -coverpkg ./... -race ./...
# Get coverage data
- go tool cover -func=testdata/coverage.out
- go tool cover -html=testdata/coverage.out -o testdata/coverage.html
- go tool cover -func=testdata/coverage-noncuda.out
- go tool cover -html=testdata/coverage-noncuda.out -o testdata/coverage-noncuda.html
# Test Coverage Check
- go tool cover -func=testdata/coverage.out | grep "total:" | awk '{print $3}' | sed 's/\%//g' > testdata/coverage-percentage.txt
- export CODE_CHECK=$(echo "$(cat testdata/coverage-percentage.txt) >= $MIN_CODE_COVERAGE" | bc -l)
- (if [ "$CODE_CHECK" == "1" ]; then echo "Minimum coverage of $MIN_CODE_COVERAGE succeeded"; else echo "Minimum coverage of $MIN_CODE_COVERAGE failed"; exit 1; fi);
artifacts:
paths:
- testdata/
build:
stage: build
image: $DOCKER_IMAGE
except:
- tags
script:
- mkdir -p release
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' ./...
artifacts:
paths:
- release/
# TODO(?): have server pull in the latest from release/master automatically for this pipeline, if possible
trigger_server:
stage: trigger_server
......
......@@ -23,11 +23,12 @@ clean:
devinstall:
mkdir -p ../../lib
mv libpowmo*.so ../../lib
cp powm_odd_export.h ../../lib
install:
mkdir -p /opt/xxnetwork/lib
mkdir -p /opt/xxnetwork/include
cp libpowmo*.so /opt/xxnetwork/lib
mv libpowmo*.so /opt/xxnetwork/lib
cp powm_odd_export.h /opt/xxnetwork/include
kepler:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment