2021-02-03 23:07:00 +01:00
|
|
|
image: python:3.7
|
2021-01-25 22:50:43 +01:00
|
|
|
|
|
|
|
# Change pip's cache directory to be inside the project directory since we can
|
|
|
|
# only cache local items.
|
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
2021-02-03 22:48:06 +01:00
|
|
|
GIT_SUBMODULE_STRATEGY: recursive # fetch submodule
|
2021-01-25 22:50:43 +01:00
|
|
|
# Pip's cache doesn't store the python packages
|
|
|
|
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
|
|
|
|
#
|
|
|
|
# If you want to also cache the installed packages, you have to install
|
|
|
|
# them in a virtualenv and cache it as well.
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache/pip
|
|
|
|
- venv/
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- python -V # Print out python version for debugging
|
|
|
|
- pip install poetry
|
|
|
|
- pip install virtualenv
|
|
|
|
- pip install mypy
|
|
|
|
- virtualenv venv
|
|
|
|
- source venv/bin/activate
|
|
|
|
- poetry install
|
2021-02-03 22:36:39 +01:00
|
|
|
- curl -O -u gitlabci:$COLLISION_SECRETS https://lw1.at/s/astro/collision-secrets/save.jsonl
|
2021-02-03 22:51:20 +01:00
|
|
|
- mkdir initcon
|
|
|
|
- curl -o initcon/conditions_many.input -u gitlabci:$COLLISION_SECRETS https://lw1.at/s/astro/collision-secrets/conditions_many.input
|
2021-01-25 22:50:43 +01:00
|
|
|
|
|
|
|
mypy:
|
2021-02-03 23:02:41 +01:00
|
|
|
needs: [ ]
|
2021-02-03 22:40:35 +01:00
|
|
|
stage: tests
|
2021-01-25 22:50:43 +01:00
|
|
|
script:
|
2021-02-03 22:36:39 +01:00
|
|
|
- mypy *.py
|
2021-02-03 22:43:50 +01:00
|
|
|
allow_failure: true
|
2021-01-25 22:50:43 +01:00
|
|
|
|
2021-02-03 22:36:39 +01:00
|
|
|
simulation_run:
|
2021-02-03 22:40:35 +01:00
|
|
|
stage: simulation
|
2021-02-03 23:02:41 +01:00
|
|
|
needs: [ ]
|
2021-02-03 22:36:39 +01:00
|
|
|
script:
|
2021-02-03 22:43:50 +01:00
|
|
|
- poetry run python water_sim.py test_simulationrun test
|
2021-02-03 22:36:39 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- "test_simulationrun*"
|
|
|
|
expire_in: 60 days
|
|
|
|
|
|
|
|
visualisation:
|
2021-02-03 22:40:35 +01:00
|
|
|
stage: visualisation
|
2021-02-03 22:38:52 +01:00
|
|
|
needs:
|
|
|
|
- simulation_run
|
2021-02-03 22:36:39 +01:00
|
|
|
script:
|
2021-02-03 22:43:50 +01:00
|
|
|
- poetry run python analyze.py test_simulationrun
|
|
|
|
- poetry run python collisionhistory.py test_simulationrun
|
|
|
|
- poetry run python collisionstats.py test_simulationrun
|
2021-02-03 23:07:00 +01:00
|
|
|
|
|
|
|
graph:
|
|
|
|
stage: visualisation
|
|
|
|
needs:
|
|
|
|
- simulation_run
|
|
|
|
script:
|
2021-02-03 22:43:50 +01:00
|
|
|
- poetry run python graph.py test_simulationrun
|
2021-02-03 23:07:00 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- test_simulationrun.gv
|
|
|
|
expire_in: 30 days
|
2021-02-03 23:02:41 +01:00
|
|
|
|
|
|
|
video:
|
|
|
|
stage: visualisation
|
|
|
|
needs:
|
|
|
|
- simulation_run
|
|
|
|
script:
|
|
|
|
- poetry run python timeplot.py test_simulationrun --save
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- test_simulationrun.mp4
|
|
|
|
expire_in: 30 days
|
2021-01-25 22:50:43 +01:00
|
|
|
|
2021-02-03 22:40:35 +01:00
|
|
|
stages:
|
|
|
|
- tests
|
|
|
|
- simulation
|
|
|
|
- visualisation
|