From e7db3e0dc44a98e616d4535bdd0f58db8d65a9d6 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Thu, 14 Dec 2023 23:22:52 +0100 Subject: Add CI test stage Squashed with: Pass artifacts (well, the whole repo) to test stage YAML syntax error. Since I saw a glimpse of the repo being reinitialised two tries ago, perhaps it saves everything tracked and just adding untracked files should be enough. Have to specify which image to use, else it uses default and fails with linking errors. Have to reinstall everything in the new image. Though not strictly required, but it's good to have a working git describe output in logs. gdb is required for tests, too --- .gitlab-ci.yml | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67559b8..40767c8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ # Copied in from Moubootaur Legends's Hercules .gitlab-ci.yml stages: - build + - test variables: &base_vars DEBIAN_COMMON_PACKAGES: make git gcc g++ @@ -10,7 +11,6 @@ variables: &base_vars .prerequisites: &prerequisites before_script: - - echo "Building TMW Athena $CI_BUILD_NAME" - uname -a - apt-get update - apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES @@ -25,6 +25,7 @@ re:ubuntu1804:build: <<: *base_vars INSTALL_PACKAGES: python script: + - echo "Building TMW Athena $CI_BUILD_NAME" - git submodule update --init - git fetch -t - printf "Building TMW Athena version %s\n" "$(git describe --tags HEAD)" @@ -32,6 +33,12 @@ re:ubuntu1804:build: - make - whoami - make install + artifacts: # required for test stage + untracked: true + expire_in: 30 mins + + + # Next server OS? re:ubuntu2204:build: @@ -50,3 +57,32 @@ re:ubuntu2204:build: - make - whoami - make install + artifacts: # required for test stage + untracked: true + expire_in: 30 mins + + + + +re:ubuntu1804:test: + <<: *prerequisites + stage: test + image: ubuntu:18.04 + variables: + <<: *base_vars + INSTALL_PACKAGES: python gdb + script: + - printf "Testing TMW Athena version %s\n" "$(git describe --tags HEAD)" + - make test + +re:ubuntu2204:test: + <<: *prerequisites + stage: test + image: ubuntu:22.04 + variables: + <<: *base_vars + INSTALL_PACKAGES: python2 gdb + script: + - ln -s /usr/bin/python2 /usr/bin/python + - printf "Testing TMW Athena version %s\n" "$(git describe --tags HEAD)" + - make test -- cgit v1.2.3-70-g09d2