This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
118 lines (108 loc) · 4.33 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/rust/tags/
image: "debian:latest"
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
- venv/
# - StarCraftII/
- target/
# Optional: Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service
# services:
# - mysql:latest
# - redis:latest
# - postgres:latest
# Optional: Install a C compiler, cmake and git into the container.
# You will often need this when you (or any of your dependencies) depends on C code.
before_script:
#Install required apt packages
- apt-get update -yqq
- apt-get install -yqq --no-install-recommends ca-certificates
- apt-get install -yqq --no-install-recommends build-essential
- apt-get install -yqq --no-install-recommends python3-dev
- apt-get install -yqq --no-install-recommends curl
- apt-get install -yqq --no-install-recommends python3-distutils
- apt-get install -yqq --no-install-recommends python3-apt
- apt-get install -yqq --no-install-recommends unzip
- apt-get install -yqq --no-install-recommends pkg-config
- apt-get install -yqq --no-install-recommends wget
- apt-get install -yqq --no-install-recommends xz-utils
- apt-get install -yqq --no-install-recommends unzip
- apt-get install -yqq --no-install-recommends libssl-dev
# #Download SC2 # Skip until it's fixed
# - DIR=StarCraftII/
# - if ! [ -d "$DIR" ]; then echo "Download" \
# && wget -q 'http://blzdistsc2-a.akamaihd.net/Linux/SC2.4.10.zip' \
# && unzip -P iagreetotheeula SC2.4.10.zip \
# && ls .
# && rm SC2.4.10.zip \
# && ln -s StarCraftII/Maps StarCraftII/maps \
# && rm -Rf StarCraftII/maps/* \
# && wget -q 'http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2019Season3.zip' \
# && unzip -P iagreetotheeula Ladder2019Season3.zip \
# && rm Ladder2019Season3.zip \
# && mv Ladder2019Season3 StarCraftII/maps; fi
# - ls .
# - wget https://gitlab.com/aiarena/aiarena-test-bots/-/archive/master/aiarena-test-bots-master.tar.gz
# - tar -xf aiarena-test-bots-master.tar.gz
# - SC2_PROXY_BASE=StarCraftII/
#
#build:python:
# image: "quay.io/pypa/manylinux1_x86_64:latest"
# script:
# - yum update
# - yum install -y openssl-devel
# - export PATH=/opt/python/cp35-cp35m/bin/:/opt/python/cp36-cp36m/bin/:/opt/python/cp37-cp37m/bin/:/opt/python/cp38-cp38/bin/:$PATH
# - yum install curl
# - python3 -m pip install maturin
# - PROTOC_ZIP=protoc-3.7.1-linux-x86_64.zip
# - curl --insecure -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/$PROTOC_ZIP
# - unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
# - unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
# - rm -f $PROTOC_ZIP
# - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# - source $HOME/.cargo/env
# - rustup toolchain install stable
# - rustup default stable
# - maturin build
build:
stage: build
script:
# Install python libs
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- python3 get-pip.py
- pip3 install cffi virtualenv
- virtualenv venv
- source venv/bin/activate
- pip3 install maturin
- pip3 install burnysc2
# Install protoc
- PROTOC_ZIP=protoc-3.7.1-linux-x86_64.zip
- curl --insecure -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/$PROTOC_ZIP
- unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
- unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
- rm -f $PROTOC_ZIP
# Install Rust
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- source $HOME/.cargo/env
- rustup toolchain install stable
- rustup default stable
- maturin build
artifacts:
paths:
- "target/wheels/*.whl"
sonarqube-check:
stage: test
script:
- wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-linux.zip
- unzip sonar-scanner-cli-4.2.0.1873-linux.zip
- sonar-scanner-4.2.0.1873-linux/bin/sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=rust-arenaclient -Dsonar.sources=. -Dsonar.host.url=https://sonar.m1nd.io -Dsonar.login=$SONAR_TOKEN
allow_failure: true
only:
- merge_requests
- master