Skip to content

fix

fix #115

Workflow file for this run

name: Build Image
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
workflow_call:
jobs:
build:
strategy:
fail-fast: false
max-parallel: 5
matrix:
chapter:
# - name: chap1
# folder: Chapter01
# - name: chap2
# folder: Chapter02
# - name: chap3
# folder: Chapter03
# - name: chap4
# folder: Chapter04
# - name: chap5
# folder: Chapter05
# - name: chap6
# folder: Chapter06
# - name: chap7
# folder: Chapter07
# - name: chap8
# folder: Chapter08
# - name: chap9
# folder: Chapter09
# - name: chap10
# folder: Chapter10
- name: chap13
folder: Chapter13
runs-on: ubuntu-latest
name: Image ${{ matrix.chapter.name }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Build Image
id: build
run: |
cd docker
docker build . --target ${{ matrix.chapter.name }} \
--build-arg branch=${{ steps.extract_branch.outputs.branch }} \
-t graph-machine-learning:latest --no-cache
- name: Test Image
id: tests
env:
KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }}
KAGGLE_TOKEN: ${{ secrets.KAGGLE_TOKEN }}
run: |

Check failure on line 64 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yaml

Invalid workflow file

You have an error in your yaml syntax on line 64
docker network create my-network
# Start Neo4j and JanusGraph if we are testing chapter 10
if [ "${{ matrix.chapter.name }}" == "chap10" ];
then
docker run --rm --detach --name janusgraph \
--publish=8182:8182 \
janusgraph/janusgraph:1.1.0
docker network connect my-network janusgraph
docker run --rm --detach --name neo4j \
--publish=7474:7474 --publish=7687:7687 \
--user="$(id -u):$(id -g)" \
--env NEO4J_AUTH=none \
--env NEO4J_PLUGINS='["graph-data-science"]' \
neo4j:5.26.0
docker network connect my-network neo4j
fi
# Start Neo4j if we are testing chapter 13
if [ "${{ matrix.chapter.name }}" == "chap13" ];
then
docker run --rm --detach --name neo4j \
--publish=7474:7474 --publish=7687:7687 \
--user="$(id -u):$(id -g)" \
--env NEO4J_AUTH=none \
--env NEO4J_PLUGINS='["graph-data-science"]' \
neo4j:5.26.0
docker network connect my-network neo4j
docker run --rm --detach --name ollama \
--publish=11434:11434 \
--volume olama:/root/.ollama \
ollama/ollama:0.6.4
docker network connect my-network ollama
fi
mkdir -p data
chmod -R 777 data
docker run \
--rm --detach -v "$(pwd)/data:/data" \
--name graph-machine-learning-box \
--env KAGGLE_USERNAME=${KAGGLE_USERNAME} \
--env KAGGLE_KEY=${KAGGLE_TOKEN} \
--env NEO4J_HOST=neo4j \
--env JANUSGRAPH_HOST=janusgraph \
--env OLLAMA_HOST=ollama \
graph-machine-learning:latest
docker network connect my-network graph-machine-learning-box
# Run tests
cd docker
./tests.sh ${{ matrix.chapter.folder }}
- name: tmate session if tests fail
if: failure() && github.event_name == 'workflow_dispatch'
uses: mxschmitt/action-tmate@v3