diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..f1a08d7587dc59736533c9c6955f05bb4cb301b8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,59 @@ +# Pipeline config +image: registry.gitlab.arm.com/tosa/tosa-serialization:prod + +stages: + - build + - test + +variables: + DEBIAN_FRONTEND: noninteractive + +default: + tags: + - amd64 + +# Jobs +build-ser-lib: + stage: build + artifacts: + paths: + - ./ + expire_in: 1h + script: | + + mkdir build + cd build + cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. + + make -j $(nproc) + +run-gtest: + stage: test + needs: ["build-ser-lib"] + dependencies: + - build-ser-lib + variables: + GIT_STRATEGY: none + script: | + cd build + ctest + +run-npy-tests: + stage: test + needs: ["build-ser-lib"] + dependencies: + - build-ser-lib + variables: + GIT_STRATEGY: none + script: | + python test/scripts/test_npy_fileio.py + +run-pytests: + stage: test + needs: ["build-ser-lib"] + dependencies: + - build-ser-lib + variables: + GIT_STRATEGY: none + script: | + pytest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea017ecf500e7885840016cb52452e2bb7ce5e37 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM ubuntu:24.04 + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt update && apt upgrade -y && apt install -y \ + git\ + wget\ + clang\ + cmake\ + clang-18\ + libssl-dev\ + zlib1g-dev\ + libbz2-dev\ + libreadline-dev\ + libsqlite3-dev\ + libffi-dev\ + liblzma-dev\ + tk-dev\ + libgdbm-dev\ + libncursesw5-dev\ + xz-utils\ + uuid-dev + +# Set up Python +RUN git clone https://github.com/pyenv/pyenv.git .pyenv +ENV PYENV_ROOT="$HOME/.pyenv" +ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH +RUN pyenv install 3.12.3 &&\ + pyenv global 3.12.3 &&\ + pyenv rehash + +# Point clang to clang-18 +RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 &&\ + update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 + +COPY requirements_dev.txt . +RUN pip install -r requirements_dev.txt +CMD [ "/bin/bash" ] \ No newline at end of file diff --git a/README.md b/README.md index 967c3500c5f78cb336c8d6665e0242a6e209bb7c..b7e4870d68455fa953d1441ea655421edb93f61c 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,10 @@ For Microsoft Visual C++ (MSVC) * MSVC build tools (tested with 19.41.34123.0) ##### Install Additional pip Packages (for unit tests) -* flatbuffers (tested with 23.5.26) -* numpy (tested with 2.1.1) -* ml_dtypes (tested with 0.5.0) -* pytest (tested with 8.3.3) Any platform ```bash -pip install flatbuffers==23.5.26 numpy==2.1.1 ml_dtypes==0.5.0 pytest==8.3.3 +pip install -r requirements_dev.txt ``` # Compilation diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 0000000000000000000000000000000000000000..e872df8791911084b7bf7691aadaba9aad16579b --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,4 @@ +flatbuffers==24.3.25 +numpy==2.1.1 +ml_dtypes==0.5.0 +pytest==8.3.3 \ No newline at end of file