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

Remove go steps from pipeline

parent 670de031
No related branches found
No related tags found
No related merge requests found
...@@ -8,15 +8,10 @@ cache: ...@@ -8,15 +8,10 @@ cache:
variables: variables:
REPO_DIR: gitlab.com/elixxir REPO_DIR: gitlab.com/elixxir
REPO_NAME: gpumaths REPO_NAME: gpumathsnative
DOCKER_IMAGE: elixxirlabs/cuda-go:latest DOCKER_IMAGE: elixxirlabs/cuda-go:latest
MIN_CODE_COVERAGE: "20.0"
before_script: before_script:
##
## Go Setup
##
- go version || echo "Go executable not found."
- echo $CI_BUILD_REF - echo $CI_BUILD_REF
- echo $CI_PROJECT_DIR - echo $CI_PROJECT_DIR
- echo $PWD - echo $PWD
...@@ -27,15 +22,9 @@ before_script: ...@@ -27,15 +22,9 @@ before_script:
- chmod 700 ~/.ssh - chmod 700 ~/.ssh
- ssh-keyscan -t rsa gitlab.com > ~/.ssh/known_hosts - ssh-keyscan -t rsa gitlab.com > ~/.ssh/known_hosts
- git config --global url."git@gitlab.com:".insteadOf "https://gitlab.com/" - 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: stages:
- setup - setup
- test
- build
- tag
- trigger_server - trigger_server
- trigger_release_server - trigger_release_server
...@@ -45,63 +34,13 @@ setup: ...@@ -45,63 +34,13 @@ setup:
except: except:
- tags - tags
script: script:
- go mod vendor -v
- go build ./...
- go mod tidy
- cd cgbnBindings/powm - cd cgbnBindings/powm
- make turing - make turing
- make devinstall - make devinstall
artifacts: artifacts:
paths: paths:
- vendor/
- lib/ - 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 # TODO(?): have server pull in the latest from release/master automatically for this pipeline, if possible
trigger_server: trigger_server:
stage: trigger_server stage: trigger_server
......
...@@ -23,11 +23,12 @@ clean: ...@@ -23,11 +23,12 @@ clean:
devinstall: devinstall:
mkdir -p ../../lib mkdir -p ../../lib
mv libpowmo*.so ../../lib mv libpowmo*.so ../../lib
cp powm_odd_export.h ../../lib
install: install:
mkdir -p /opt/xxnetwork/lib mkdir -p /opt/xxnetwork/lib
mkdir -p /opt/xxnetwork/include 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 cp powm_odd_export.h /opt/xxnetwork/include
kepler: kepler:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment