-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy path.gitlab-ci.yml
71 lines (67 loc) · 2.21 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
stages:
- tag-docker-image
- test
unit-tests:
tags: [ docker ]
stage: test
image: $CI_REGISTRY_IMAGE:master
script:
- eval "$(/opt/conda/bin/conda shell.bash hook)"
- conda init bash
- source ~/.bashrc
- printenv
- export CONDA_ENVS_PATH=~
- conda env list
- conda env update -f environment.yaml --prefix /t4c22
- conda activate /t4c22
- python -c 'import torch_geometric'
- pre-commit run --all
- pytest --junitxml=report.xml -v -s --no-cov-on-fail --cov=.
- flake8 . --exit-zero --output-file=flake8.txt
- coverage xml
- python -m pip install -e .
artifacts:
when: always
reports:
junit: report.xml
cobertura: coverage.xml
paths:
- flake8.txt
library-install-tests:
tags: [ docker ]
stage: test
image: continuumio/miniconda3
script:
- cat /etc/apt/sources.list
- sed --in-place --regexp-extended 's|http://|https://|g' /etc/apt/sources.list
- cat /etc/apt/sources.list
- apt update -qy && apt-get install -y make gcc g++ libstdc++6
- eval "$(/opt/conda/bin/conda shell.bash hook)"
- conda init bash
- source ~/.bashrc
- printenv
- export CONDA_ENVS_PATH=$PWD
- conda create -n t4c22_empty python=3.9 pip
- conda env list
- conda activate t4c22_empty
- python --version
- ls -al
- python -m pip install .
- python -m pip install .[torch-geometric] -f https://data.pyg.org/whl/torch-1.11.0+cpu.html
- cd /tmp
- python -c 'import torch_geometric'
- python -c 'import torch; print(torch.cuda.is_available())'
- python -m t4c22.misc.check_torch_geometric_setup
tag-docker-image:
# CAVEAT: this can be brittle - if the build fails and it's not fixed, the docker image will only be re-built on the next update...
only:
changes:
- Dockerfile
tags: [ shell ]
stage: tag-docker-image
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE:master || true
- docker build --cache-from $CI_REGISTRY_IMAGE:master --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
- docker image tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:master
- docker image push $CI_REGISTRY_IMAGE:master