Skip to content

Commit 54c1289

Browse files
authored
Merge pull request #730 from JuliaRobotics/ci/github
Converted travis to github ci
2 parents 6b7bfef + 53d1e26 commit 54c1289

File tree

8 files changed

+204
-12
lines changed

8 files changed

+204
-12
lines changed

.github/workflows/ci.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branch:
6+
- master
7+
- develop
8+
- release**
9+
tags:
10+
- v**
11+
12+
jobs:
13+
test:
14+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
15+
runs-on: ${{ matrix.os }}
16+
env:
17+
JULIA_PKG_SERVER: ""
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
version:
22+
- '1.6'
23+
- 'nightly'
24+
os:
25+
- ubuntu-latest
26+
arch:
27+
- x64
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v2
31+
32+
- name: Setup Julia
33+
uses: julia-actions/setup-julia@v1
34+
with:
35+
version: ${{ matrix.version }}
36+
arch: ${{ matrix.arch }}
37+
38+
- name: Cache Artifacts
39+
uses: actions/cache@v1
40+
env:
41+
cache-name: cache-artifacts
42+
with:
43+
path: ~/.julia/artifacts
44+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
45+
restore-keys: |
46+
${{ runner.os }}-test-${{ env.cache-name }}-
47+
${{ runner.os }}-test-
48+
${{ runner.os }}-
49+
50+
- name: Julia Build Pkg
51+
uses: julia-actions/julia-buildpkg@latest
52+
53+
- name: Git Test Credentials
54+
run: |
55+
git config --global user.name Tester
56+
git config --global user.email [email protected]
57+
58+
- name: Run tests
59+
env:
60+
IIF_TEST: false
61+
DO_CGDFG_TESTS: false
62+
DFG_USE_CGDFG: false
63+
uses: julia-actions/julia-runtest@latest
64+
continue-on-error: ${{ matrix.version == 'nightly' }}
65+
66+
- name: Process Coverage
67+
uses: julia-actions/julia-processcoverage@v1
68+
69+
- name: Code Coverage
70+
uses: codecov/codecov-action@v1
71+
with:
72+
file: lcov.info
73+
74+
test-cfg:
75+
# if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/release**'
76+
name: w/ LGPL ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
77+
runs-on: ${{ matrix.os }}
78+
env:
79+
JULIA_PKG_SERVER: ""
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
version:
84+
- '1.6'
85+
os:
86+
- ubuntu-latest
87+
arch:
88+
- x64
89+
steps:
90+
- name: Checkout
91+
uses: actions/checkout@v2
92+
93+
- name: Setup Julia
94+
uses: julia-actions/setup-julia@v1
95+
with:
96+
version: ${{ matrix.version }}
97+
arch: ${{ matrix.arch }}
98+
99+
- name: Install neo4j
100+
run: |
101+
sudo add-apt-repository -y ppa:openjdk-r/ppa
102+
sudo apt-get update
103+
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
104+
echo 'deb https://debian.neo4j.com stable 3.5' | sudo tee /etc/apt/sources.list.d/neo4j.list
105+
sudo apt-get update
106+
apt list -a neo4j
107+
sudo apt-get install neo4j
108+
sudo service neo4j start
109+
sleep 10
110+
curl -v POST http://neo4j:neo4j@localhost:7474/user/neo4j/password -d"password=test"
111+
# sudo neo4j-admin set-initial-password test
112+
curl -I http://localhost:7474/
113+
114+
- name: Cache Artifacts
115+
uses: actions/cache@v1
116+
env:
117+
cache-name: cache-artifacts
118+
with:
119+
path: ~/.julia/artifacts
120+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
121+
restore-keys: |
122+
${{ runner.os }}-test-${{ env.cache-name }}-
123+
${{ runner.os }}-test-
124+
${{ runner.os }}-
125+
126+
- name: Julia Build Pkg
127+
uses: julia-actions/julia-buildpkg@latest
128+
129+
- name: Git Test Credentials
130+
run: |
131+
git config --global user.name Tester
132+
git config --global user.email [email protected]
133+
134+
- name: Run tests
135+
env:
136+
IIF_TEST: false
137+
DO_CGDFG_TESTS: true
138+
DFG_USE_CGDFG: true
139+
uses: julia-actions/julia-runtest@latest
140+
141+
- name: Process Coverage
142+
uses: julia-actions/julia-processcoverage@v1
143+
144+
- name: Code Coverage
145+
uses: codecov/codecov-action@v1
146+
with:
147+
file: lcov.info
148+
149+
docs:
150+
needs: test
151+
name: Documentation
152+
runs-on: ubuntu-latest
153+
continue-on-error: true
154+
steps:
155+
- name: Checkout
156+
uses: actions/checkout@v2
157+
158+
- name: Setup julia
159+
uses: julia-actions/setup-julia@v1
160+
with:
161+
version: 1.6
162+
arch: x64
163+
164+
- name: Build Docs
165+
env:
166+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
168+
run: |
169+
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
170+
julia --project=docs/ docs/make.jl
171+

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
Click on badges to follow links:
44

55
Release v0.13 | Release v0.14 | Dev | Coverage | Documentation |
6-
---------|---------|-----|------------|------------|
7-
[![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/)
6+
--------------|---------------|-----|----------|---------------|
7+
[![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/)
88

99

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

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

1818
DistributedFactorGraphs.jl provides a flexible factor graph API for use in the [Caesar.jl](https://github.com/JuliaRobotics/Caesar.jl) ecosystem. The package supplies:
1919
* A standardized API for interacting with factor graphs

src/entities/DFGVariable.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ end
300300
$SIGNATURES
301301
The default DFGVariable constructor.
302302
"""
303-
function DFGVariable(label::Symbol, variableType::T;
303+
function DFGVariable(label::Symbol, variableType::Type{T};
304304
timestamp::Union{DateTime,ZonedDateTime}=now(localzone()),
305305
nstime::Nanosecond = Nanosecond(0),
306306
tags::Set{Symbol}=Set{Symbol}(),
@@ -309,14 +309,20 @@ function DFGVariable(label::Symbol, variableType::T;
309309
smallData::Dict{Symbol, SmallDataTypes}=Dict{Symbol, SmallDataTypes}(),
310310
dataDict::Dict{Symbol, AbstractDataEntry}=Dict{Symbol,AbstractDataEntry}(),
311311
solvable::Int=1) where {T <: InferenceVariable, P}
312-
312+
#
313313
if timestamp isa DateTime
314314
DFGVariable{T}(label, ZonedDateTime(timestamp, localzone()), nstime, tags, estimateDict, solverDataDict, smallData, dataDict, Ref(solvable))
315315
else
316316
DFGVariable{T}(label, timestamp, nstime, tags, estimateDict, solverDataDict, smallData, dataDict, Ref(solvable))
317317
end
318318
end
319319

320+
DFGVariable(label::Symbol,
321+
variableType::T;
322+
solverDataDict::Dict{Symbol, VariableNodeData{T,P}}=Dict{Symbol, VariableNodeData{T,getPointType(T)}}(),
323+
kw...) where {T <: InferenceVariable, P} = DFGVariable(label, T; solverDataDict=solverDataDict, kw...)
324+
#
325+
320326
function DFGVariable(label::Symbol,
321327
solverData::VariableNodeData{T};
322328
timestamp::Union{DateTime,ZonedDateTime}=now(localzone()),

src/services/CustomPrinting.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ function printVariable( io::IO, vert::DFGVariable;
9494
println(ioc)
9595
end
9696
end
97+
nothing
9798
end
9899

99100
printFactor(vert::DFGFactor; kwargs...) = printFactor(stdout::IO, vert; kwargs...)
@@ -150,6 +151,7 @@ function printFactor( io::IO, vert::DFGFactor;
150151
println(ioc)
151152
end
152153
end
154+
nothing
153155
end
154156

155157

src/services/Serialization.jl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,28 @@ function unpackVariable(dfg::G,
160160

161161
variableType = getTypeFromSerializationModule(variableTypeString)
162162
isnothing(variableType) && error("Cannot deserialize variableType '$variableTypeString' in variable '$label'")
163+
pointType = getPointType(variableType)
163164

164165
if unpackSolverData
165166
packed = JSON2.read(packedProps["solverDataDict"], Dict{String, PackedVariableNodeData})
166-
solverData = Dict(Symbol.(keys(packed)) .=> map(p -> unpackVariableNodeData(dfg, p), values(packed)))
167+
solverData = Dict{Symbol, VariableNodeData{variableType, pointType}}(Symbol.(keys(packed)) .=> map(p -> unpackVariableNodeData(dfg, p), values(packed)))
167168
else
168-
solverData = Dict{Symbol, VariableNodeData}()
169+
solverData = Dict{Symbol, VariableNodeData{variableType, pointType}}()
169170
end
170171
# Rebuild DFGVariable using the first solver variableType in solverData
171-
variable = DFGVariable{variableType}(Symbol(packedProps["label"]), timestamp, nstime, Set(tags), ppeDict, solverData, smallData, Dict{Symbol,AbstractDataEntry}(), Ref(packedProps["solvable"]))
172+
# @info "dbg Serialization 171" variableType Symbol(packedProps["label"]) timestamp nstime ppeDict solverData smallData Dict{Symbol,AbstractDataEntry}() Ref(packedProps["solvable"])
173+
# variable = DFGVariable{variableType}(Symbol(packedProps["label"]), timestamp, nstime, Set(tags), ppeDict, solverData, smallData, Dict{Symbol,AbstractDataEntry}(), Ref(packedProps["solvable"]))
174+
variable = DFGVariable( Symbol(packedProps["label"]),
175+
variableType,
176+
timestamp=timestamp,
177+
nstime=nstime,
178+
tags=Set{Symbol}(tags),
179+
estimateDict=ppeDict,
180+
solverDataDict=solverData,
181+
smallData=smallData,
182+
dataDict=Dict{Symbol,AbstractDataEntry}(),
183+
solvable=packedProps["solvable"] )
184+
#
172185

173186
# Now rehydrate complete DataEntry type.
174187
if unpackBigData

test/fileDFGTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using TimeZones
1111
dfg = DistributedFactorGraphs._getDuplicatedEmptyDFG(dfg)
1212

1313
if typeof(dfg) <: CloudGraphsDFG
14-
@warn "TEST: Nuking all data for user '$(dfg.userId)', robot '$(dfg.robotId)'!"
14+
@warn "TEST: Removing all data for user '$(dfg.userId)', robot '$(dfg.robotId)'!"
1515
clearRobot!!(dfg)
1616
# Need to recreate this, otherwise there is going to be an issue when creating the nodes.
1717
createDfgSessionIfNotExist(dfg)

test/iifInterfaceTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
global dfg,v1,v2,f1
22

33
if typeof(dfg) <: CloudGraphsDFG
4-
@warn "TEST: Nuking all data for user '$(dfg.userId)'!"
4+
@warn "TEST: Removing all data for user '$(dfg.userId)'!"
55
clearUser!!(dfg)
66
createDfgSessionIfNotExist(dfg)
77
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if get(ENV, "DO_CGDFG_TESTS", "") == "true"
3939
LightDFG,
4040
CloudGraphsDFG,
4141
]
42-
@warn "TEST: Nuking all data for user 'testUserId'!"
42+
@warn "TEST: Removing all data for user 'testUserId'!"
4343
clearUser!!(CloudGraphsDFG(userId="testUserId"))
4444

4545
else

0 commit comments

Comments
 (0)