Add docker based gitlab ci config

This commit is contained in:
Jan 2021-03-04 07:45:29 -08:00
parent 6937e7441c
commit ba699d36df
7 changed files with 38 additions and 5 deletions

View File

@ -3,7 +3,7 @@ stages:
- test - test
build-gcc: build-gcc:
image: gcc:latest image: laupetin/gcc-9-multilib:latest
stage: build stage: build
cache: cache:
paths: paths:
@ -13,11 +13,14 @@ build-gcc:
- docker - docker
- linux - linux
script: script:
- "echo pwd: $(pwd)"
- "echo ls: $(ls)"
- "echo ls ci: $(ls ./ci)"
- "./generate.sh" - "./generate.sh"
- "make -C build -j$(nproc) config=release_x86 all" - "./build-linux.sh"
test-gcc: test-gcc:
image: gcc:latest image: laupetin/gcc-9-multilib:latest
stage: test stage: test
cache: cache:
paths: paths:
@ -27,8 +30,6 @@ test-gcc:
- docker - docker
- linux - linux
script: 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/ObjCommonTests"
- "./build/lib/Release_x86/tests/ZoneCodeGeneratorLibTests" - "./build/lib/Release_x86/tests/ZoneCodeGeneratorLibTests"
- "./build/lib/Release_x86/tests/ZoneCommonTests" - "./build/lib/Release_x86/tests/ZoneCommonTests"

View File

@ -1,3 +1,6 @@
#!/bin/bash #!/bin/bash
# Go to repository root
cd "$(dirname "$0")" || exit 2
make -C build -j$(nproc) config=release_x86 all make -C build -j$(nproc) config=release_x86 all

6
ci/Dockerfile Normal file
View File

@ -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"]

6
ci/create-image.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# Go to repository root
cd "$(dirname "$0")" || exit 2
docker build -t oat .

6
ci/scripts/build.sh Executable file
View File

@ -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"

8
ci/scripts/test.sh Executable file
View File

@ -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

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
# Go to repository root
cd "$(dirname "$0")" || exit 2
git submodule update --init --recursive git submodule update --init --recursive
tools/premake5 gmake2 tools/premake5 gmake2