make CI work
authorJacob Lifshay <programmerjake@gmail.com>
Wed, 16 Aug 2023 02:10:31 +0000 (19:10 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Sun, 10 Sep 2023 19:00:59 +0000 (12:00 -0700)
.gitlab-ci.yml
pyproject.toml [new file with mode: 0644]

index c3ca516fc2695aced2e4d186b000f0a2694f399e..c6c38943cabb9e1f5c88eaa22a8dc1b8ef21560f 100644 (file)
@@ -10,7 +10,7 @@ cache:
 variables:
     PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
     GIT_SUBMODULE_STRATEGY: recursive
-    GIT_DEPTH: 500
+    GIT_DEPTH: "500"
 
 build:
     stage: build
@@ -20,11 +20,29 @@ build:
         - apt-get -o dir::cache::archives="$(pwd)/apt-cache" update
         - >-
             apt-get -o dir::cache::archives="$(pwd)/apt-cache" -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
-            binutils-powerpc64-linux-gnu binutils-powerpc64le-linux-gnu
-            autoconf gperf libgmp-dev libmpfr-dev libssl-dev curl
+            build-essential
+            git
+            python3-dev
+            python3-pip
+            python3-setuptools
+            python3-setuptools-scm
+            python3-wheel
+            pkg-config
+            tcl-dev
+            libreadline-dev
+            bison
+            flex
+            libffi-dev
+            ccache
+            python3-venv
+            binutils-powerpc64-linux-gnu
+            binutils-powerpc64le-linux-gnu
+            autoconf
+            gperf
+            libgmp-dev
+            libmpfr-dev
+            libssl-dev
+            curl
         - export PATH="/usr/lib/ccache:$PATH"
         - export CCACHE_BASEDIR="$PWD"
         - export CCACHE_DIR="$PWD/ccache"
@@ -33,43 +51,55 @@ build:
         - ccache --show-stats || true
         - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
         - source $HOME/.cargo/env
-    after_script:
-        - export CCACHE_DIR="$PWD/ccache"
-        - ccache --show-stats
     script:
-        - python3 -m venv .env
+        - python3 -m venv --system-site-packages .env
         - . .env/bin/activate
-        - pip install nose
+        - pip install pytest-xdist==3.3.1 pytest==7.3.1
+
+        - git clone --depth 1 https://git.libre-soc.org/git/pytest-output-to-files.git pytest-output-to-files
+        - pushd pytest-output-to-files
+        - git rev-parse HEAD
+        - python3 setup.py develop
+        - popd
 
-        - git clone --depth 1 https://github.com/SRI-CSL/yices2.git yices2
+        - git clone --depth 1 -b Yices-2.6.4 https://github.com/SRI-CSL/yices2.git yices2
         - pushd yices2
         - autoconf
         - ./configure
-        - make -j$(nproc) > /dev/null
+        - make -j$(nproc)
         - make install
         - popd
 
-        - git clone --depth 1 https://github.com/YosysHQ/yosys.git yosys
+        - git clone --depth 1 -b yosys-0.17 https://github.com/YosysHQ/yosys.git yosys
         - pushd yosys
         - make config-gcc
-        - make -j$(nproc) > /dev/null
+        - make -j$(nproc)
         - make install
         - popd
         - yosys -V
 
-        - git clone --depth 1 https://github.com/YosysHQ/SymbiYosys.git SymbiYosys
+        - git clone https://github.com/YosysHQ/SymbiYosys.git SymbiYosys
         - pushd SymbiYosys
-        - make install > /dev/null
+        - git checkout d10e472edf4ea9be3aa6347b264ba575fbea933a
+        - make install
         - popd
 
-        - git clone --depth 1 https://github.com/nmigen/nmigen.git nmigen
+        - git clone --depth 1 https://gitlab.com/nmigen/nmigen.git nmigen
         - pushd nmigen
-        - python setup.py develop
+        - git rev-parse HEAD
+        - python3 setup.py develop
+        - popd
+
+        - git clone --depth 1 https://git.libre-soc.org/git/mdis.git mdis
+        - pushd mdis
+        - git rev-parse HEAD
+        - python3 setup.py develop
         - popd
 
         - git clone --depth 1 https://git.libre-soc.org/git/nmutil.git nmutil
         - pushd nmutil
-        - python setup.py develop
+        - git rev-parse HEAD
+        - python3 setup.py develop
         - popd
 
         - git clone --depth 1 https://git.libre-soc.org/git/nmigen-soc.git nmigen-soc
@@ -86,9 +116,7 @@ build:
         - git clone --depth 1 https://git.libre-soc.org/git/openpower-isa.git openpower-isa
         - pushd openpower-isa
         - python3 setup.py develop
-        - make -j$(nproc) svanalysis > /dev/null
-        - make -j$(nproc) pyfnwriter > /dev/null 2>&1
-        - make -j$(nproc) pywriter > /dev/null 2>&1
+        - if ! out="$(make 2>&1)"; then echo "$out"; exit 1; fi
         - popd
 
         - git clone --depth 1 https://git.libre-soc.org/git/c4m-jtag.git c4m-jtag
@@ -97,8 +125,9 @@ build:
         - popd
 
         - IEEE754FPU_PATH="$(pwd)"/ieee754fpu
-        - git clone --depth 1 --recursive https://github.com/billzorn/sfpy.git sfpy
+        - git clone --depth 1 --recursive -b v0.6.0 https://github.com/billzorn/sfpy.git sfpy
         - pushd sfpy
+        - git apply "$IEEE754FPU_PATH"/sfpy.patch
         - pushd berkeley-softfloat-3
         - git apply "$IEEE754FPU_PATH"/berkeley-softfloat.patch
         - popd
@@ -106,11 +135,11 @@ build:
         - git apply ../softposit_sfpy_build.patch
         - git apply "$IEEE754FPU_PATH"/SoftPosit.patch
         - popd
-        - pip install --upgrade -r requirements.txt
+        - pip install -r requirements.txt
         - make lib -j$(nproc)
         - make cython -j$(nproc)
         - make wheel -j$(nproc)
-        - pip install dist/sfpy*.whl
+        - pip install --force-reinstall dist/sfpy*.whl
         - popd
 
         - python3 -m pip install 'maturin>=0.11,<0.12'
@@ -121,4 +150,4 @@ build:
         - popd
 
         - python setup.py develop
-        - nosetests -v --processes=-1 --process-timeout=120 -w src/
+        - SILENCELOG='!*,default' pytest -v --maxfail=10
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644 (file)
index 0000000..e21c7c4
--- /dev/null
@@ -0,0 +1,11 @@
+[tool.pytest.ini_options]
+minversion = "6.0"
+python_classes = ""
+python_functions = ""
+testpaths = ["src/soc"]
+required_plugins = ["pytest-xdist>=1.0.0", "pytest-output-to-files>=0.1.0"]
+addopts = [
+    "-n",
+    "auto",
+    "--shorten-output-dir=test-out",
+]