Skip to content

Commit a0b1b20

Browse files
authored
ECONNREFUSED temporary fix (#499)
1 parent fd88139 commit a0b1b20

File tree

12 files changed

+109
-112
lines changed

12 files changed

+109
-112
lines changed

.github/workflows/TagBot.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
name: TagBot
22
on:
3-
schedule:
4-
- cron: 0 * * * *
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: 3
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
523
jobs:
624
TagBot:
25+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
726
runs-on: ubuntu-latest
827
steps:
928
- uses: JuliaRegistries/TagBot@v1
1029
with:
1130
token: ${{ secrets.GITHUB_TOKEN }}
31+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci-master-workflow.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/ci-pr-workflow.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test:
14+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
version:
20+
- 'lts'
21+
- '1'
22+
arch: [x64]
23+
os: [ubuntu-latest, windows-latest, macos-latest]
24+
include:
25+
- os: ubuntu-latest
26+
prefix: xvfb-run
27+
28+
steps:
29+
- name: Ubuntu dependencies
30+
if: startsWith(matrix.os, 'ubuntu')
31+
run: |
32+
sudo apt -y update
33+
sudo apt -y install lynx # for debugging electron
34+
- uses: actions/checkout@v4
35+
- uses: julia-actions/setup-julia@latest
36+
with:
37+
version: ${{ matrix.version }}
38+
arch: ${{ matrix.arch }}
39+
- uses: julia-actions/cache@v2
40+
- uses: julia-actions/julia-buildpkg@latest
41+
- uses: julia-actions/julia-runtest@latest
42+
with:
43+
prefix: ${{ matrix.prefix }}
44+
- uses: julia-actions/julia-processcoverage@latest
45+
- uses: codecov/codecov-action@v5
46+
with:
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
fail_ci_if_error: false
49+
file: lcov.info

.github/workflows/deploy_docs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ on:
66
pull_request:
77
workflow_dispatch:
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
docdeploy:
1115
runs-on: ubuntu-latest
1216
steps:
13-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1418
- uses: julia-actions/julia-buildpkg@latest
1519
- uses: julia-actions/julia-docdeploy@latest
1620
env:

.github/workflows/label.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ PlotlyKaleido = "2.2.5"
4545
Reexport = "0.2, 1"
4646
Requires = "1.0"
4747
WebIO = "0.8"
48-
julia = "1.3, 1.4, 1.5, 1.6"
48+
julia = "1.6"
4949

5050
[extras]
5151
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"

src/PlotlyJS.jl

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,25 @@ for k in [:add_hrect!, :add_hline!, :add_vrect!, :add_vline!, :add_shape!, :add_
166166
end
167167
end
168168

169-
end # module
169+
function unsafe_electron(deb=false) # https://github.com/JuliaGizmos/Blink.jl/issues/325#issuecomment-2252670794
170+
# workaround for github.com/JuliaGizmos/Blink.jl/issues/325
171+
# inspired from github.com/Eben60/PackageMaker.jl/commit/297219f5c14845bf75de4475cabab4dbf6e6599d
172+
@eval Blink.AtomShell Window(args...; kwargs...) = Window(shell(; debug = $deb), args...; kwargs...)
173+
174+
@eval Blink.AtomShell function init(; debug = $deb)
175+
electron() # Check path exists
176+
p, dp = port(), port()
177+
debug && inspector(dp)
178+
dbg = debug ? "--inspect=$dp" : []
179+
# vvvvvvvvvvvv begin addition
180+
cmd = `$(electron()) --no-sandbox $dbg $mainjs port $p`
181+
# ^^^^^^^^^^^^ end addition
182+
proc = (debug ? run_rdr : run)(cmd; wait = false)
183+
conn = try_connect(ip"127.0.0.1", p)
184+
shell = Electron(proc, conn)
185+
initcbs(shell)
186+
return shell
187+
end
188+
end
189+
190+
end # module

src/display.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ function SyncPlot(
149149
SyncPlot(p, scope, nothing)
150150
end
151151

152-
function plot(args...; kwargs...)
153-
SyncPlot(Plot(args...; kwargs...))
154-
end
152+
plot(args...; kwargs...) = SyncPlot(Plot(args...; kwargs...))
155153

156154
# Add some basic Julia API methods on SyncPlot that just forward onto the Plot
157155
Base.size(sp::SyncPlot) = size(sp.plot)

test/blink.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using Blink, WebIO
22

33
t() = scatter(y=rand(10))
4+
45
p = plot([t(), t(), t(), t()])
56
w = Blink.Window()
67
body!(w, p.scope)
7-
sleep(3.0) # make sure we give time for svg to render
8+
sleep(5) # make sure we give time for svg to render
89

910
# hook up testing observables
1011
on(p.scope["__gd_contents"]) do x end

test/kaleido.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ end
1111
continue
1212
end
1313
fn = tempname() * "." * ext
14-
@show func, fn
14+
# @show func, fn
1515
myplot(fn, func) == fn
1616
@test isfile(fn)
1717
rm(fn)

test/runtests.jl

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
module PlotlyJSTest
2-
using Test
3-
41
using PlotlyJS
5-
const M = PlotlyJS
6-
7-
# using Blink
8-
# !Blink.AtomShell.isinstalled() && Blink.AtomShell.install()
2+
using Test
93

10-
# include("blink.jl")
4+
if Sys.islinux()
5+
debug = Base.get_bool_env("CI", false) ? false : true
6+
PlotlyJS.unsafe_electron(debug)
7+
include("blink.jl")
8+
end
119
include("kaleido.jl")
1210

1311
# these are public API
1412
@test isfile(PlotlyJS._js_path)
1513
@test !isempty(PlotlyJS._js_version)
1614
@test !startswith(PlotlyJS._js_version, "v")
17-
18-
end

0 commit comments

Comments
 (0)