-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
85 lines (78 loc) · 2.05 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
stages:
- prepare
- build
- test
- build_docs_stage
- update_docs
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
prepare_python_env:
stage: prepare
image: python:3.10
script:
- python3 -m venv .venv
- source .venv/bin/activate
- pip install -r docs/requirements.txt
artifacts:
paths:
- .venv/
build_scalpel:
stage: build
image: python:3.10
script:
- apt-get update -y
- apt-get install -y openjdk-17-jdk
- ./gradlew build
artifacts:
paths:
- scalpel/build/libs/*.jar
build_javadoc:
stage: build
image: python:3.10
script:
- apt-get update -y
- apt-get install -y openjdk-17-jdk
- ./gradlew javadoc
artifacts:
paths:
- scalpel/build/docs/javadoc/
build_docs:
stage: build_docs_stage
dependencies:
- prepare_python_env
- build_javadoc
image: python:3.10
script:
- apt-get update -y
- apt-get install -y hugo
- source .venv/bin/activate
- rm -rf docs/public/javadoc/
- cp -r scalpel/build/docs/javadoc/ docs/public/javadoc/
- cd docs && ./build.py --no-javadoc
artifacts:
paths:
- docs/public/
run_tests:
stage: test
dependencies:
- prepare_python_env
image: python:3.10
script:
- source .venv/bin/activate
- sh run_tests.sh
update_docs:
stage: update_docs
only:
- main
image: debian
script:
- export GIT_SSL_NO_VERIFY=true
- apt-get update && apt-get install -y git
- git config --global user.email "ci@fakegitlab.com"
- git config --global user.name "GitLab CI"
- git remote set-url origin "${CI_REPOSITORY_URL}"
- git fetch origin main:main # Fetch main branch
- git checkout main # Switch to main branch
- git add docs/public/
- git commit -m "Update generated docs [skip ci]" || echo "No changes to commit"
- git push origin main