diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25e42eab..a6d7250a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - test build-gcc: - image: gcc:latest + image: laupetin/gcc-9-multilib:latest stage: build cache: paths: @@ -13,11 +13,14 @@ build-gcc: - docker - linux script: + - "echo pwd: $(pwd)" + - "echo ls: $(ls)" + - "echo ls ci: $(ls ./ci)" - "./generate.sh" - - "make -C build -j$(nproc) config=release_x86 all" + - "./build-linux.sh" test-gcc: - image: gcc:latest + image: laupetin/gcc-9-multilib:latest stage: test cache: paths: @@ -27,8 +30,6 @@ test-gcc: - docker - linux script: - - "./generate.sh" - - "make -C build -j$(nproc) config=release_x86 ObjCommonTests ZoneCodeGeneratorLibTests ZoneCommonTests" - "./build/lib/Release_x86/tests/ObjCommonTests" - "./build/lib/Release_x86/tests/ZoneCodeGeneratorLibTests" - "./build/lib/Release_x86/tests/ZoneCommonTests" diff --git a/build-linux.sh b/build-linux.sh index 4f689813..d83828fe 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -1,3 +1,6 @@ #!/bin/bash +# Go to repository root +cd "$(dirname "$0")" || exit 2 + make -C build -j$(nproc) config=release_x86 all \ No newline at end of file diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 00000000..ffe65afb --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,6 @@ +FROM ubuntu:focal + +RUN /bin/sh -c "dpkg --add-architecture i386" +RUN /bin/sh -c "apt-get update && apt-get upgrade -y && apt-get install -y git make g++ gcc-9 g++-9 gcc-9-multilib g++-9-multilib" + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/ci/create-image.sh b/ci/create-image.sh new file mode 100755 index 00000000..2837b72b --- /dev/null +++ b/ci/create-image.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Go to repository root +cd "$(dirname "$0")" || exit 2 + +docker build -t oat . \ No newline at end of file diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh new file mode 100755 index 00000000..d42648c4 --- /dev/null +++ b/ci/scripts/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Go to repository root +cd "$(dirname "$0")/../.." || exit 2 + +docker run --rm -v "$(pwd):/mnt/oat" oat /bin/bash -c "/mnt/oat/generate.sh && /mnt/oat/build-linux.sh" \ No newline at end of file diff --git a/ci/scripts/test.sh b/ci/scripts/test.sh new file mode 100755 index 00000000..50e6fb54 --- /dev/null +++ b/ci/scripts/test.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Go to repository root +cd "$(dirname "$0")/../../build/lib" || exit 2 + +./Release_x86/tests/ObjCommonTests +./Release_x86/tests/ZoneCodeGeneratorLibTests +./Release_x86/tests/ZoneCommonTests \ No newline at end of file diff --git a/generate.sh b/generate.sh index 19f533e4..ffb1e39b 100755 --- a/generate.sh +++ b/generate.sh @@ -1,4 +1,7 @@ #!/bin/bash +# Go to repository root +cd "$(dirname "$0")" || exit 2 + git submodule update --init --recursive tools/premake5 gmake2 \ No newline at end of file