-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (55 loc) · 1.43 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
stages:
- test
- documentation
default:
image: python:3.10
before_script:
- python --version
- pip --version
- echo "$TRANSPILER_PATH"
tests:
stage: test
script:
- cd ./$TRANSPILER_PATH
- pip install --upgrade pip
- pip install .[all]
- python tests/run_tests.py
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
linting:
stage: test
script:
- pip install flake8
- flake8 $TRANSPILER_PATH
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
pages:
stage: documentation
script:
- echo "Deploying GitLab documentation"
- pip install pdoc3
- pip install ./$TRANSPILER_PATH/.
- pdoc --html ./$TRANSPILER_PATH/rivet_transpiler --output-dir public_gitlab
- mv public_gitlab/rivet_transpiler/* public_gitlab/
- echo "Deployed GitLab documentation to $CI_PAGES_URL"
artifacts:
paths:
- public_gitlab
# expire_in: 20 minutes
publish: public_gitlab
rules:
- if: $CI_COMMIT_REF_NAME == "develop"
github_documentation:
stage: documentation
script:
- echo "Deploying GitHub documentation"
- apt update
- apt -y install gcc python3-dev pandoc python3-psutil
- pip3 install ./$TRANSPILER_PATH/.
- pip3 install -r ./$TRANSPILER_PATH/docs/requirements.txt
- python3 -m sphinx -b html ./$TRANSPILER_PATH/docs/source public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH