-
Notifications
You must be signed in to change notification settings - Fork 328
113 lines (106 loc) · 3.38 KB
/
test_suite.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Test Suite
on:
pull_request:
branches:
- master
push:
branches:
- master
# Explicitly grant the `secrets.GITHUB_TOKEN` no permissions.
permissions: {}
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files --show-diff-on-failure
unit-and-integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# https://stackoverflow.com/a/64592785
- name: neo4j 4 instance setup
run: |
docker run --detach \
--name neo4j-4 \
--env NEO4J_AUTH=none \
--publish 7474:7474 \
--publish 7473:7473 \
--publish 7687:7687 \
neo4j:4.4-community
- uses: actions/setup-python@v2
with:
python-version: "3.10"
# Cache our pip dir for efficiency; see https://medium.com/ai2-blog/python-caching-in-github-actions-e9452698e98d.
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('setup.py') }}-${{ hashFiles('test-requirements.txt') }}
- name: Install cartography
run: |
pip install -e .
pip install -r test-requirements.txt
- name: Wait for neo4j 4 to be ready
timeout-minutes: 1
run: (docker logs -f neo4j-4 & ) | grep -q Started
- name: make test_unit
run: make test_unit
- name: make test_integration
run: make test_integration
unit-and-integration-tests-neo4j5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# https://stackoverflow.com/a/64592785
- name: neo4j 5 setup
run: |
docker run --detach \
--name neo4j-5 \
--env NEO4J_AUTH=none \
--publish 7474:7474 \
--publish 7473:7473 \
--publish 7687:7687 \
neo4j:5
- uses: actions/setup-python@v2
with:
python-version: "3.10"
# Cache our pip dir for efficiency; see https://medium.com/ai2-blog/python-caching-in-github-actions-e9452698e98d.
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('setup.py') }}-${{ hashFiles('test-requirements.txt') }}
- name: Install cartography
run: |
pip install -e .
pip install -r test-requirements.txt
- name: Wait for neo4j 5 to be ready
timeout-minutes: 1
run: (docker logs -f neo4j-5 & ) | grep -q Started
- name: make test_unit
run: make test_unit
- name: make test_integration
run: make test_integration
build-dist-docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v3
with:
file: dist.Dockerfile
push: false # only build the image, don't push it anywhere
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}