Skip to content

Commit

Permalink
Merge pull request #730 from JuliaRobotics/ci/github
Browse files Browse the repository at this point in the history
Converted travis to github ci
  • Loading branch information
dehann authored Jun 29, 2021
2 parents 6b7bfef + 53d1e26 commit 54c1289
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 12 deletions.
171 changes: 171 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: CI
on:
pull_request:
push:
branch:
- master
- develop
- release**
tags:
- v**

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
env:
JULIA_PKG_SERVER: ""
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Julia
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}

- name: Cache Artifacts
uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Julia Build Pkg
uses: julia-actions/julia-buildpkg@latest

- name: Git Test Credentials
run: |
git config --global user.name Tester
git config --global user.email [email protected]
- name: Run tests
env:
IIF_TEST: false
DO_CGDFG_TESTS: false
DFG_USE_CGDFG: false
uses: julia-actions/julia-runtest@latest
continue-on-error: ${{ matrix.version == 'nightly' }}

- name: Process Coverage
uses: julia-actions/julia-processcoverage@v1

- name: Code Coverage
uses: codecov/codecov-action@v1
with:
file: lcov.info

test-cfg:
# if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/release**'
name: w/ LGPL ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
env:
JULIA_PKG_SERVER: ""
strategy:
fail-fast: false
matrix:
version:
- '1.6'
os:
- ubuntu-latest
arch:
- x64
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Julia
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}

- name: Install neo4j
run: |
sudo add-apt-repository -y ppa:openjdk-r/ppa
sudo apt-get update
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable 3.5' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
apt list -a neo4j
sudo apt-get install neo4j
sudo service neo4j start
sleep 10
curl -v POST http://neo4j:neo4j@localhost:7474/user/neo4j/password -d"password=test"
# sudo neo4j-admin set-initial-password test
curl -I http://localhost:7474/
- name: Cache Artifacts
uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Julia Build Pkg
uses: julia-actions/julia-buildpkg@latest

- name: Git Test Credentials
run: |
git config --global user.name Tester
git config --global user.email [email protected]
- name: Run tests
env:
IIF_TEST: false
DO_CGDFG_TESTS: true
DFG_USE_CGDFG: true
uses: julia-actions/julia-runtest@latest

- name: Process Coverage
uses: julia-actions/julia-processcoverage@v1

- name: Code Coverage
uses: codecov/codecov-action@v1
with:
file: lcov.info

docs:
needs: test
name: Documentation
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup julia
uses: julia-actions/setup-julia@v1
with:
version: 1.6
arch: x64

- name: Build Docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: |
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
julia --project=docs/ docs/make.jl
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
Click on badges to follow links:

Release v0.13 | Release v0.14 | Dev | Coverage | Documentation |
---------|---------|-----|------------|------------|
[![Build Status][dfg-build-v0.13]][dfg-build-url] | [![Build Status][dfg-build-v0.14]][dfg-build-url] | [![Build Status][dfg-build-img]][dfg-build-url] <br> [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![codecov.io][dfg-cov-img]][dfg-cov-url] <br> [![Percentage of issues still open](https://isitmaintained.com/badge/open/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![docs](https://img.shields.io/badge/DFGDocs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) <br> [![docs](https://img.shields.io/badge/CaesarDocs-latest-blue.svg)](http://juliarobotics.github.io/Caesar.jl/latest/)
--------------|---------------|-----|----------|---------------|
[![Build Status][dfg-build-v0.13]][dfg-build-url] | [![Build Status][dfg-build-v0.14]][dfg-build-url] | [![CI][dfg-build-img]][dfg-build-url] <br> [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![codecov.io][dfg-cov-img]][dfg-cov-url] <br> [![Percentage of issues still open](https://isitmaintained.com/badge/open/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![docs](https://img.shields.io/badge/DFGDocs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) <br> [![docs](https://img.shields.io/badge/CaesarDocs-latest-blue.svg)](http://juliarobotics.github.io/Caesar.jl/latest/)


[dfg-build-v0.13]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.13
[dfg-build-v0.14]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.14

[dfg-cov-img]: https://codecov.io/github/JuliaRobotics/DistributedFactorGraphs.jl/coverage.svg?branch=master
[dfg-cov-url]: https://codecov.io/github/JuliaRobotics/DistributedFactorGraphs.jl?branch=master
[dfg-build-img]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=master
[dfg-build-url]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl
[dfg-build-img]: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/actions/workflows/ci.yml/badge.svg
[dfg-build-url]: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/actions/workflows/ci.yml

DistributedFactorGraphs.jl provides a flexible factor graph API for use in the [Caesar.jl](https://github.com/JuliaRobotics/Caesar.jl) ecosystem. The package supplies:
* A standardized API for interacting with factor graphs
Expand Down
10 changes: 8 additions & 2 deletions src/entities/DFGVariable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ end
$SIGNATURES
The default DFGVariable constructor.
"""
function DFGVariable(label::Symbol, variableType::T;
function DFGVariable(label::Symbol, variableType::Type{T};
timestamp::Union{DateTime,ZonedDateTime}=now(localzone()),
nstime::Nanosecond = Nanosecond(0),
tags::Set{Symbol}=Set{Symbol}(),
Expand All @@ -309,14 +309,20 @@ function DFGVariable(label::Symbol, variableType::T;
smallData::Dict{Symbol, SmallDataTypes}=Dict{Symbol, SmallDataTypes}(),
dataDict::Dict{Symbol, AbstractDataEntry}=Dict{Symbol,AbstractDataEntry}(),
solvable::Int=1) where {T <: InferenceVariable, P}

#
if timestamp isa DateTime
DFGVariable{T}(label, ZonedDateTime(timestamp, localzone()), nstime, tags, estimateDict, solverDataDict, smallData, dataDict, Ref(solvable))
else
DFGVariable{T}(label, timestamp, nstime, tags, estimateDict, solverDataDict, smallData, dataDict, Ref(solvable))
end
end

DFGVariable(label::Symbol,
variableType::T;
solverDataDict::Dict{Symbol, VariableNodeData{T,P}}=Dict{Symbol, VariableNodeData{T,getPointType(T)}}(),
kw...) where {T <: InferenceVariable, P} = DFGVariable(label, T; solverDataDict=solverDataDict, kw...)
#

function DFGVariable(label::Symbol,
solverData::VariableNodeData{T};
timestamp::Union{DateTime,ZonedDateTime}=now(localzone()),
Expand Down
2 changes: 2 additions & 0 deletions src/services/CustomPrinting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function printVariable( io::IO, vert::DFGVariable;
println(ioc)
end
end
nothing
end

printFactor(vert::DFGFactor; kwargs...) = printFactor(stdout::IO, vert; kwargs...)
Expand Down Expand Up @@ -150,6 +151,7 @@ function printFactor( io::IO, vert::DFGFactor;
println(ioc)
end
end
nothing
end


Expand Down
19 changes: 16 additions & 3 deletions src/services/Serialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,28 @@ function unpackVariable(dfg::G,

variableType = getTypeFromSerializationModule(variableTypeString)
isnothing(variableType) && error("Cannot deserialize variableType '$variableTypeString' in variable '$label'")
pointType = getPointType(variableType)

if unpackSolverData
packed = JSON2.read(packedProps["solverDataDict"], Dict{String, PackedVariableNodeData})
solverData = Dict(Symbol.(keys(packed)) .=> map(p -> unpackVariableNodeData(dfg, p), values(packed)))
solverData = Dict{Symbol, VariableNodeData{variableType, pointType}}(Symbol.(keys(packed)) .=> map(p -> unpackVariableNodeData(dfg, p), values(packed)))
else
solverData = Dict{Symbol, VariableNodeData}()
solverData = Dict{Symbol, VariableNodeData{variableType, pointType}}()
end
# Rebuild DFGVariable using the first solver variableType in solverData
variable = DFGVariable{variableType}(Symbol(packedProps["label"]), timestamp, nstime, Set(tags), ppeDict, solverData, smallData, Dict{Symbol,AbstractDataEntry}(), Ref(packedProps["solvable"]))
# @info "dbg Serialization 171" variableType Symbol(packedProps["label"]) timestamp nstime ppeDict solverData smallData Dict{Symbol,AbstractDataEntry}() Ref(packedProps["solvable"])
# variable = DFGVariable{variableType}(Symbol(packedProps["label"]), timestamp, nstime, Set(tags), ppeDict, solverData, smallData, Dict{Symbol,AbstractDataEntry}(), Ref(packedProps["solvable"]))
variable = DFGVariable( Symbol(packedProps["label"]),
variableType,
timestamp=timestamp,
nstime=nstime,
tags=Set{Symbol}(tags),
estimateDict=ppeDict,
solverDataDict=solverData,
smallData=smallData,
dataDict=Dict{Symbol,AbstractDataEntry}(),
solvable=packedProps["solvable"] )
#

# Now rehydrate complete DataEntry type.
if unpackBigData
Expand Down
2 changes: 1 addition & 1 deletion test/fileDFGTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using TimeZones
dfg = DistributedFactorGraphs._getDuplicatedEmptyDFG(dfg)

if typeof(dfg) <: CloudGraphsDFG
@warn "TEST: Nuking all data for user '$(dfg.userId)', robot '$(dfg.robotId)'!"
@warn "TEST: Removing all data for user '$(dfg.userId)', robot '$(dfg.robotId)'!"
clearRobot!!(dfg)
# Need to recreate this, otherwise there is going to be an issue when creating the nodes.
createDfgSessionIfNotExist(dfg)
Expand Down
2 changes: 1 addition & 1 deletion test/iifInterfaceTests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
global dfg,v1,v2,f1

if typeof(dfg) <: CloudGraphsDFG
@warn "TEST: Nuking all data for user '$(dfg.userId)'!"
@warn "TEST: Removing all data for user '$(dfg.userId)'!"
clearUser!!(dfg)
createDfgSessionIfNotExist(dfg)
end
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if get(ENV, "DO_CGDFG_TESTS", "") == "true"
LightDFG,
CloudGraphsDFG,
]
@warn "TEST: Nuking all data for user 'testUserId'!"
@warn "TEST: Removing all data for user 'testUserId'!"
clearUser!!(CloudGraphsDFG(userId="testUserId"))

else
Expand Down

0 comments on commit 54c1289

Please sign in to comment.