add .gitlab-ci.yml
authorJacob Lifshay <programmerjake@gmail.com>
Sun, 5 Apr 2020 22:44:49 +0000 (15:44 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Sun, 5 Apr 2020 22:44:49 +0000 (15:44 -0700)
.gitlab-ci.yml [new file with mode: 0644]

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..d39c2ad
--- /dev/null
@@ -0,0 +1,71 @@
+image: debian:10
+
+cache:
+    paths:
+        - ccache
+
+build:
+    stage: build
+    before_script:
+        - apt-get update
+        - >-
+            apt-get -y install
+            build-essential git python3-dev python3-pip
+            python3-setuptools python3-wheel pkg-config tcl-dev
+            libreadline-dev bison flex libffi-dev ccache python3-venv
+        - export PATH="/usr/lib/ccache:$PATH"
+        - export CCACHE_BASEDIR="$PWD"
+        - export CCACHE_DIR="$PWD/ccache"
+        - export CCACHE_COMPILERCHECK=content
+        - ccache --zero-stats || true
+        - ccache --show-stats || true
+    after_script:
+        - export CCACHE_DIR="$PWD/ccache"
+        - ccache --show-stats
+    script:
+        - python3 -m venv .env
+        - . .env/bin/activate
+        - pip install nose
+
+        - git clone --depth 1 https://github.com/YosysHQ/yosys.git yosys
+        - pushd yosys
+        - make config-gcc
+        - make -j$(nproc)
+        - make install
+        - popd
+        - yosys -V
+
+        - git clone --depth 1 https://github.com/nmigen/nmigen.git nmigen
+        - pushd nmigen
+        - python setup.py develop
+        - popd
+
+        - git clone --depth 1 git://git.libre-riscv.org/nmutil.git nmutil
+        - pushd nmutil
+        - python setup.py develop
+        - popd
+
+        - git clone --depth 1 git://git.libre-riscv.org/ieee754fpu.git ieee754fpu
+        - pushd ieee754fpu
+        - python setup.py develop
+        - popd
+
+        - IEEE754FPU_PATH="$(pwd)"/ieee754fpu
+        - git clone --depth 1 --recursive https://github.com/billzorn/sfpy.git sfpy
+        - pushd sfpy
+        - pushd berkeley-softfloat-3
+        - git apply "$IEEE754FPU_PATH"/berkeley-softfloat.patch
+        - popd
+        - pushd SoftPosit
+        - git apply ../softposit_sfpy_build.patch
+        - git apply "$IEEE754FPU_PATH"/SoftPosit.patch
+        - popd
+        - pip install --upgrade -r requirements.txt
+        - make lib -j$(nproc)
+        - make cython -j$(nproc)
+        - make wheel -j$(nproc)
+        - pip install dist/sfpy*.whl
+        - popd
+
+        - python setup.py develop
+        - nosetests -v --processes=-1