-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
64 lines (60 loc) · 2.88 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
image: docker:latest
variables:
GOOGLE_TAG: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_SHA
GOOGLE_TAG_LATEST: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:latest
stages:
- build
- test
# - publish
build:
stage: build
variables:
BUILD_CONTAINER: build-$CI_COMMIT_SHA
before_script:
- docker rm -f $BUILD_CONTAINER || true
script:
- docker build -t $GOOGLE_TAG .
- docker run --name $BUILD_CONTAINER $GOOGLE_TAG echo "container ran"
- docker cp $BUILD_CONTAINER:/build/android-core-release-unsigned.aar beaconsdk-core-release-unsigned-$CI_PIPELINE_ID.aar
- docker cp $BUILD_CONTAINER:/build/android-client-wallet-release-unsigned.aar beaconsdk-client-wallet-release-unsigned-$CI_PIPELINE_ID.aar
- docker cp $BUILD_CONTAINER:/build/android-client-wallet-compat-release-unsigned.aar beaconsdk-client-wallet-compat-release-unsigned-$CI_PIPELINE_ID.aar
- docker cp $BUILD_CONTAINER:/build/android-blockchain-substrate-release-unsigned.aar beaconsdk-blockchain-substrate-release-unsigned-$CI_PIPELINE_ID.aar
- docker cp $BUILD_CONTAINER:/build/android-blockchain-tezos-release-unsigned.aar beaconsdk-blockchain-tezos-release-unsigned-$CI_PIPELINE_ID.aar
- docker cp $BUILD_CONTAINER:/build/android-transport-p2p-matrix-release-unsigned.aar beaconsdk-transport-p2p-matrix-release-unsigned-$CI_PIPELINE_ID.aar
after_script:
- docker rm -f $BUILD_CONTAINER || true
tags:
- docker
artifacts:
paths:
- beaconsdk-core-release-unsigned-$CI_PIPELINE_ID.aar
- beaconsdk-client-wallet-release-unsigned-$CI_PIPELINE_ID.aar
- beaconsdk-client-wallet-compat-release-unsigned-$CI_PIPELINE_ID.aar
- beaconsdk-blockchain-substrate-release-unsigned-$CI_PIPELINE_ID.aar
- beaconsdk-blockchain-tezos-release-unsigned-$CI_PIPELINE_ID.aar
- beaconsdk-transport-p2p-matrix-release-unsigned-$CI_PIPELINE_ID.aar
unit:
allow_failure: true
stage: test
variables:
UNIT_CONTAINER: unit-$CI_COMMIT_SHA
LINT_CONTAINER: lint-$CI_COMMIT_SHA
before_script:
- docker rm -f $UNIT_CONTAINER || true
- docker rm -f $LINT_CONTAINER || true
script:
- docker run --name $UNIT_CONTAINER $GOOGLE_TAG /bin/bash -c "/build/gradlew --project-dir /build testMockReleaseUnitTest"
- docker run --name $LINT_CONTAINER $GOOGLE_TAG /bin/bash -c "/build/gradlew --project-dir /build lint"
after_script:
- docker cp $UNIT_CONTAINER:/build/core/build/reports/tests/testMockReleaseUnitTest unit-test-report-$CI_PIPELINE_ID
- docker cp $LINT_CONTAINER:/build/core/build/reports/lint-results.html lint-report-$CI_PIPELINE_ID.html
- docker rm -f $UNIT_CONTAINER || true
- docker rm -f $LINT_CONTAINER || true
tags:
- docker
artifacts:
when: always
name: "reports-$CI_PIPELINE_ID"
paths:
- unit-test-report-$CI_PIPELINE_ID
- lint-report-$CI_PIPELINE_ID.html