From 14441c2378c4b536487aa5e8f5403a14c16e4e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 14 Aug 2023 18:39:22 +0200 Subject: [PATCH] Adde gitea workflow: tests --- .gitea/workflows/Dockerfile_tests | 9 +++++++ .gitea/workflows/tests.yml | 30 +++++++++++++++++++++++ bfcodegen/_test_example.tgz | Bin 0 -> 13313 bytes bfcodegen/enum-generate_test.go | 39 +++++++++++++++++++++++++----- cmdext/cmdrunner_test.go | 22 ++++++++--------- rfctime/rfc3339.go | 4 +-- rfctime/rfc3339Nano.go | 4 +-- rfctime/rfc3339Nano_test.go | 3 ++- 8 files changed, 89 insertions(+), 22 deletions(-) create mode 100644 .gitea/workflows/Dockerfile_tests create mode 100644 .gitea/workflows/tests.yml create mode 100644 bfcodegen/_test_example.tgz diff --git a/.gitea/workflows/Dockerfile_tests b/.gitea/workflows/Dockerfile_tests new file mode 100644 index 0000000..ba6ae3a --- /dev/null +++ b/.gitea/workflows/Dockerfile_tests @@ -0,0 +1,9 @@ +FROM golang:latest + +RUN apt install -y make curl python3 && go install gotest.tools/gotestsum@latest + +COPY . /source + +WORKDIR /source + +CMD ["make", "test"] diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml new file mode 100644 index 0000000..22fabbc --- /dev/null +++ b/.gitea/workflows/tests.yml @@ -0,0 +1,30 @@ + +# https://docs.gitea.com/next/usage/actions/quickstart +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions +# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context + +name: Build Docker and Deploy +run-name: Build & Deploy ${{ gitea.ref }} on ${{ gitea.actor }} + +on: [push] + +jobs: + run_tests: + name: Run goext test-suite + runs-on: bfb-cicd-latest + steps: + + - name: Check out code + uses: actions/checkout@v3 + + - name: Build test docker + id: build_docker + run: echo "DOCKER_IMG_ID=$(docker build -q . -f .gitea/workflows/Dockerfile_tests || echo __err_build__)" >> $GITHUB_OUTPUT + + - name: Run tests + run: docker run --rm "${{ steps.build_docker.outputs.DOCKER_IMG_ID }}" + + - name: Cleanup + if: always() + run: docker image rm "${{ steps.build_docker.outputs.DOCKER_IMG_ID }}" + diff --git a/bfcodegen/_test_example.tgz b/bfcodegen/_test_example.tgz new file mode 100644 index 0000000000000000000000000000000000000000..500f74af4edaa87cce0ef07cda50013ea8db481f GIT binary patch literal 13313 zcmaKy(&iiqQ63vuaCB=eCrw;n>%lFnsqe8 zjeU2vL3@we&!6|dgQ1bHd96+o@SAXO3wBs*IA>Z$xbFtW)cPRE&~o~eg5@H9=Ig>+GtoT=E6ri;_Ek4}S;w`B_b$1M9Et z8i0`$$18{}cR=>AN;vQv(O^-7cxKMSAC()Sp?>`3PPDw?cdCTlM^>bo4OIGVJ1)G4tKlWKli zKi1W8Z~kwKdI*FE-+lm0E&)a&3Ps1-w-P5d*o*P$2>Bk17bz$x2n3$WuurCg@x?UF zqS9VbDlGT0IJjR{qU*C=_cJvWf65Ql){=#Vlt+3sBL4WXJ;@==d1=fNJ~9#J|l4W#Wd)f!>F`Ao9^3!GcNkNKHqPne@#j#l7H%ylTqg@gEVk)et!lOv(w3cYh+h|># zr7gDEpm57>!T1v72SsI`FU>fZ-`JLw&5+uzk37c8HC9y8=oUamRXNC+PX?iJk<2ny~! zREoe&GXQdgP3=u}XZ=oi)C(6bE{RwW{q(x(2K$0k|83_eSM+DTbq$Rx&+*#~-^<;J z-`(y{t=IRJ=@+d=v@1l>>_RKlm(!GN(Oe(ZkAaXkg630Iwz~+lt)OjTS}3(tnU$-) z#!~JjyRAGSn(!fz5*W4f%g^p6manJya*1q%T3Q&l-rrsWvKPFSVh@ErrKW2}*-l^C z3_43^IvO`!hvAFRLkv)C^F*Dj_a{zUNUAtc9A#K1gThBnfD_cwlI`vXoX(7Y(12=a+}*Wd9CndxTOLEab%*H#Y~Dw@81@xKhS_?Tdm0& z+Af-pSf`cNgGj*%qt;lZ zVQ(MD+6!#ZU`&Xg@Gj%VijERfN?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