aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCecylia Bocovich <cohosh@torproject.org>2020-07-08 10:49:41 -0400
committerCecylia Bocovich <cohosh@torproject.org>2020-07-14 09:16:23 -0400
commitc1fa4efe4b6e289758224a5a4c8bcaa3d7067449 (patch)
treed4a23fce1550570ee4a38bb883c28d619a9a1a33
parentd44fc238150c64a7a5045e756d1e9e2dbe0a3e5a (diff)
downloadsnowflake-c1fa4efe4b6e289758224a5a4c8bcaa3d7067449.tar.gz
snowflake-c1fa4efe4b6e289758224a5a4c8bcaa3d7067449.zip
Refactor android script to be in android job
-rw-r--r--.gitlab-ci.yml79
1 files changed, 42 insertions, 37 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 18902e6..04a58fc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -41,6 +41,15 @@
git
lbzip2
+.go_test: &go-test
+ - test -z "$(go fmt ./...)"
+ - go vet ./...
+ - go test -v -race ./...
+
+ - cd $CI_PROJECT_DIR/client/
+ - go get
+ - go build
+
.test-template: &test-template
artifacts:
name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
@@ -52,17 +61,35 @@
when: on_success
after_script:
- echo "Download debug artifacts from https://gitlab.com/${CI_PROJECT_PATH}/-/jobs"
- script:
- - test -z "$(go fmt ./...)"
- - go vet ./...
- - go test -v -race ./...
- - cd $CI_PROJECT_DIR/client/
- - go get
- - go build
+# -- jobs ------------------------------------------------------------
- # build for Android if this is the right job
- - test "$CI_JOB_NAME" = "android" || exit 0
+android:
+ image: registry.gitlab.com/fdroid/ci-images-client
+ variables:
+ GOPATH: "/go"
+ cache:
+ paths:
+ - .gradle/wrapper
+ - .gradle/caches
+ before_script:
+ - apt-get -qy update
+ - apt-get -qy install --no-install-recommends
+ build-essential
+ gnupg
+ wget
+ - cd /usr/local
+ - export gotarball="go1.13.12.linux-amd64.tar.gz"
+ - wget -q https://dl.google.com/go/${gotarball}
+ - wget -q https://dl.google.com/go/${gotarball}.asc
+ - curl https://dl.google.com/linux/linux_signing_key.pub | gpg --import
+ - gpg --verify ${gotarball}.asc
+ - echo "9cacc6653563771b458c13056265aa0c21b8a23ca9408278484e4efde4160618 ${gotarball}" | sha256sum -c
+ - tar -xzf ${gotarball}
+ - export PATH="/usr/local/go/bin:$GOPATH/bin:$PATH" # putting this in 'variables:' cause weird runner errors
+ - cd $CI_PROJECT_DIR
+ script:
+ - *go-test
- export GRADLE_USER_HOME=$PWD/.gradle
# This build was setup before go.mod was a thing, go back to the old days!
# 920f6791f3ec8e7467c43ee0cefffe63200bed2b broke the gomobile build.
@@ -93,47 +120,25 @@
# gomobile builds a shared library not a CLI executable
- sed -i 's,^package main$,package snowflakeclient,' snowflake.go client_test.go
- gomobile bind -v -target=android git.torproject.org/pluggable-transports/snowflake/client
-
-
-# -- jobs ------------------------------------------------------------
-
-android:
- image: registry.gitlab.com/fdroid/ci-images-client
- variables:
- GOPATH: "/go"
- cache:
- paths:
- - .gradle/wrapper
- - .gradle/caches
- before_script:
- - apt-get -qy update
- - apt-get -qy install --no-install-recommends
- build-essential
- gnupg
- wget
- - cd /usr/local
- - export gotarball="go1.13.12.linux-amd64.tar.gz"
- - wget -q https://dl.google.com/go/${gotarball}
- - wget -q https://dl.google.com/go/${gotarball}.asc
- - curl https://dl.google.com/linux/linux_signing_key.pub | gpg --import
- - gpg --verify ${gotarball}.asc
- - echo "9cacc6653563771b458c13056265aa0c21b8a23ca9408278484e4efde4160618 ${gotarball}" | sha256sum -c
- - tar -xzf ${gotarball}
- - export PATH="/usr/local/go/bin:$GOPATH/bin:$PATH" # putting this in 'variables:' cause weird runner errors
- - cd $CI_PROJECT_DIR
<<: *test-template
go-1.13:
image: golang:1.13-stretch
<<: *golang-docker-debian-template
<<: *test-template
+ script:
+ - *go-test
go-1.14:
image: golang:1.14-stretch
<<: *golang-docker-debian-template
<<: *test-template
+ script:
+ - *go-test
debian-testing:
image: debian:testing
<<: *debian-native-template
<<: *test-template
+ script:
+ - *go-test