reverted change of #aa7c62f0 in devkit

added script to run checks and tests in container
This commit is contained in:
Sven Vogel 2024-05-02 12:14:59 +02:00
parent c099a60ecf
commit 01cf8345a0
4 changed files with 50 additions and 7 deletions

View File

@ -2,7 +2,7 @@ name: "Build check gemstone in SDK"
run-name: SDK build check to ${{ inputs.deploy_target }} by @${{ github.actor }} run-name: SDK build check to ${{ inputs.deploy_target }} by @${{ github.actor }}
on: [push, pull_request] on: [push, pull_request]
env: env:
SDK: 0.2.1-alpine-3.19.1 SDK: 0.2.2-alpine-3.19.1
jobs: jobs:
build-check-sdk: build-check-sdk:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -11,4 +11,4 @@ jobs:
- name: Setup SDK - name: Setup SDK
run: docker pull servostar/gemstone:sdk-"$SDK" && docker build --tag gemstone:devkit-"$SDK" . run: docker pull servostar/gemstone:sdk-"$SDK" && docker build --tag gemstone:devkit-"$SDK" .
- name: Compile - name: Compile
run: docker run gemstone:devkit-"$SDK" make check run: docker run gemstone:devkit-"$SDK" sh run-check-test.sh

View File

@ -1,9 +1,12 @@
FROM servostar/gemstone:sdk-0.2.1-alpine-3.19.1 FROM servostar/gemstone:sdk-0.2.2-alpine-3.19.1
LABEL authors="servostar" LABEL authors="servostar"
LABEL version="0.2.1" LABEL version="0.2.2"
LABEL description="docker image for setting up the build pipeline on SDK" LABEL description="docker image for setting up the build pipeline on SDK"
LABEL website="https://github.com/Servostar/gemstone" LABEL website="https://github.com/Servostar/gemstone"
RUN git clone https://github.com/Servostar/gemstone.git /home/lorang COPY --chown=lorang src /home/lorang/src
COPY --chown=lorang tests /home/lorang/tests
COPY --chown=lorang CMakeLists.txt /home/lorang/
COPY --chown=lorang run-check-test.sh /home/lorang/
RUN cmake . RUN cmake .

40
run-check-test.sh Normal file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env sh
# Author: Sven Vogel
# Created: 02.05.2024
# Description: Builds the project and runs tests
# Returns 0 on success and 1 when something went wrong
echo "+--------------------------------------+"
echo "| BUILDING all TARGETS |"
echo "+--------------------------------------+"
make -B
if [ ! $? -eq 0 ]; then
echo "===> failed to build targets"
exit 1
fi
echo "+--------------------------------------+"
echo "| RUNNING CODE CHECK |"
echo "+--------------------------------------+"
make check
if [ ! $? -eq 0 ]; then
echo "===> failed code check..."
exit 1
fi
echo "+--------------------------------------+"
echo "| RUNNING TESTS |"
echo "+--------------------------------------+"
ctest -VV --output-on-failure --schedule-random -j 4
if [ ! $? -eq 0 ]; then
echo "===> failed tests..."
exit 1
fi
echo "+--------------------------------------+"
echo "| COMPLETED CHECK + TESTS SUCCESSFULLY |"
echo "+--------------------------------------+"

View File

@ -1,11 +1,11 @@
FROM alpine:3.19.1 FROM alpine:3.19.1
LABEL authors="servostar" LABEL authors="servostar"
LABEL version="0.2.1" LABEL version="0.2.2"
LABEL description="base image for building the gemstone programming language compiler" LABEL description="base image for building the gemstone programming language compiler"
LABEL website="https://github.com/Servostar/gemstone" LABEL website="https://github.com/Servostar/gemstone"
# install dependencies # install dependencies
RUN apk add build-base gcc make cmake bison flex git RUN apk add build-base gcc make cmake bison flex git python3
# create user for build # create user for build
RUN adduser --disabled-password lorang RUN adduser --disabled-password lorang