-
-
Notifications
You must be signed in to change notification settings - Fork 132
57 lines (47 loc) · 1.69 KB
/
code-tests-docker.yaml
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
name: Code tests (docker)
on: [pull_request]
jobs:
code-tests-docker:
name: Run code tests (docker)
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v3
# See: https://github.com/marketplace/actions/setup-miniconda
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniforge-variant: Mambaforge
channels: conda-forge
python-version: 3.8
use-mamba: true
# # Build cache of environment
# - name: Cache conda environment
# id: cache-environment
# uses: actions/cache@v2
# # Conda environment build step depends on two files,
# # so we ensure that the hash key contains both their hashes.
# with:
# path: |
# /usr/share/miniconda/envs/graphein-dev/
# key: ${{ runner.os }}-env.${{ hashFiles('environment-dev.yml') }}
- name: Build Docker container
# if: steps.cache-environment.outputs.cache-hit != 'true'
run: |
docker-compose -f docker-compose.cpu.yml up -d --build
- name: Install Graphein (Docker)
run: |
docker exec $(docker ps -q) bash -c 'pip install -e .'
- name: Run tests (Docker)
run: |
docker exec $(docker ps -q) bash -c 'pytest .'
- name: Run example notebooks (Docker)
run: |
docker exec $(docker ps -q) bash -c 'grep -l smoke_test notebooks/*.ipynb | pytest --nbval-lax --current-env'
- name: Upload code coverage
run: |
bash <(curl -s https://codecov.io/bash)