diff --git a/.github/workflows/mirror.yml.bak b/.github/workflows/mirror.yml.bak new file mode 100644 index 000000000..e1b46580b --- /dev/null +++ b/.github/workflows/mirror.yml.bak @@ -0,0 +1,20 @@ +name: Mirror GitLab Repository + +on: + push: + branches: + - master + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Push to GitLab + run: | + git remote add gitlab git@gitlab.com:ug4-project/ugcore.git + git push --mirror gitlab + env: + SSH_PRIVATE_KEY: ${{ secrets.GITLAB_SSH_PRIVATE_KEY }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..d5737ab72 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,99 @@ +# You can override the included template(s) by including variable overrides +# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings +# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/pipeline/#customization +# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings +# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings +# Note that environment variables can be set in several places +# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence +default: + tags: + - docker + - linux +variables: + GIT_CLONE_PATH: "$CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_DIR/$CI_PIPELINE_ID/ug4/ugcore" +stages: +- test +- build +- sync + +do-test: + stage: test + image: rigby132/ug4-test:latest + timeout: 4 hours + variables: + CMAKE_C_COMPILER: gcc + CMAKE_CXX_COMPILER: g++ + script: + - cd .. + - cp --update=none -R /opt/ug4/. . + - mkdir -p build + - cd build + - cmake .. -DENABLE_ALL_PLUGINS=ON -DDEBUG=ON -GNinja + - ninja -j8 + - cd .. + - cd apps/unit_tests/ + - mkdir -p build + - cd build + - cmake .. -DUSE_JSON=OFF -DINTERNAL_BOOST=ON -DDEBUG=ON -GNinja + - ninja -j8 + - cd ../../.. + - pwd + - ls -a + - source ugcore/scripts/shell/ugbash + - echo $UG4_ROOT + - "./bin/testsuite --build-info=yes --log_level=all --log_format=JUNIT --log_sink=report.xml -- --name report" + - cat ug_test_numprocs_1.log + - mv ug_test_numprocs_1.log ugcore/test.log + - cat report.xml + - mv report.xml ugcore/report.xml + artifacts: + when: always + expire_in: 1 week + paths: + - report.xml + - test.log + reports: + junit: report.xml + +build-clang: + stage: build + image: rigby132/ug4-minimal:latest + timeout: 4 hours + variables: + CMAKE_C_COMPILER: gcc + CMAKE_CXX_COMPILER: g++ + CXX_FLAGS: "-O3 -fPIC" + before_script: + - docker info + - echo "$CI_REGISTRY" + - echo "$CI_JOB_TOKEN" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin + script: + - cd .. + - cp --update=none -R /opt/ug4/. . + - mkdir -p build + - cd build + - cmake .. -DENABLE_ALL_PLUGINS=ON -DDEBUG=OFF -GNinja + - ninja -j8 + - cd .. + - cd .. + - echo -e 'FROM ubuntu:latest\nENV DEBIAN_FRONTEND=noninteractive\nRUN apt-get update + && apt-get install -y python3 \nADD ug4 /opt/ug4' > Dockerfile + - docker build -t registry.gitlab.com/ug4-project/ugcore . + - docker push registry.gitlab.com/ug4-project/ugcore + - cd ug4 + - ls -a bin + - mv bin ugcore/bin + artifacts: + when: on_success + expire_in: 1 week + paths: + - bin/* + - bin/plugins/* + +include: +- template: Jobs/SAST.gitlab-ci.yml +- template: Security/SAST.gitlab-ci.yml +- local: '/.gitlab/mirror-main.yml' + +sast: + stage: test diff --git a/.gitlab/mirror-main.yml b/.gitlab/mirror-main.yml new file mode 100644 index 000000000..1cfc42a68 --- /dev/null +++ b/.gitlab/mirror-main.yml @@ -0,0 +1,17 @@ +stages: + - sync + +sync_to_github: + stage: sync + image: alpine:latest + before_script: + - apk add --no-cache git + - git config --global user.name "UG4_BOT" + - git config --global user.email "ug4-bot@ug4.uni-frankfurt.de" + script: + - git clone --mirror https://oauth2:${CI_JOB_TOKEN}@gitlab.com/ug4-project/ugcore.git repo + - cd repo + - git remote add github https://${GITHUB_UG4BOT_NAME}:${GITHUB_UG4BOT_TOKEN}@github.com/UG4/ugcore.git + - git push --mirror github + only: + - main # Trigger on pushes to the main branch only