Skip to content

Commit 79db7ad

Browse files
authored
Update to Julia v1.9 (#15)
* Update to Julia v1.9 * Version bump * check 1.7 and windows * remove unsupported platforms * unique topic names * Test sysimage generation * Fix dev call * Fix deps * Fix sysimage test code * Fix cert path * always show resp * remoev 1.7 * update julia compat to 1.9
1 parent f68bb2c commit 79db7ad

File tree

11 files changed

+138
-14
lines changed

11 files changed

+138
-14
lines changed

.github/workflows/CI.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches:
55
- main
6-
tags: '*'
6+
tags: ["*"]
77
pull_request:
88
concurrency:
99
# Skip intermediate builds: always.
@@ -18,18 +18,14 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
version:
21-
- '1.7'
21+
- "1.9"
2222
os:
2323
- ubuntu-latest
2424
- macOS-latest
2525
arch:
2626
- x64
27-
- x86
28-
exclude:
29-
- os: macOS-latest
30-
arch: x86
3127
steps:
32-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
3329
- uses: julia-actions/setup-julia@v1
3430
with:
3531
version: ${{ matrix.version }}
@@ -46,14 +42,46 @@ jobs:
4642
with:
4743
file: ./lcov.info
4844
fail_ci_if_error: false
45+
46+
test_sysimage:
47+
name: test_sysimage ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
48+
runs-on: ${{ matrix.os }}
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
version:
53+
- "1.9"
54+
os:
55+
- ubuntu-latest
56+
- macOS-latest
57+
arch:
58+
- x64
59+
steps:
60+
- uses: actions/checkout@v3
61+
- uses: julia-actions/setup-julia@v1
62+
with:
63+
version: ${{ matrix.version }}
64+
arch: ${{ matrix.arch }}
65+
- uses: julia-actions/cache@v1
66+
- uses: julia-actions/julia-buildpkg@v1
67+
- run: |
68+
julia --project -e 'import Pkg; Pkg.develop(path=".."); Pkg.instantiate(); Pkg.build();'
69+
MQTT_ENABLED=false julia --project=sysimage -e 'import Pkg; Pkg.instantiate(); Pkg.build(); include(joinpath("sysimage", "build_sysimage.jl")); build()'
70+
MQTT_ENABLED=true julia -J sysimage/sysimage.so -e 'Foo.start()'
71+
working-directory: test_sysimage
72+
env:
73+
ENDPOINT: ${{ secrets.ENDPOINT }}
74+
CERT_STRING: ${{ secrets.CERT_STRING }}
75+
PRI_KEY_STRING: ${{ secrets.PRI_KEY_STRING }}
76+
4977
docs:
5078
name: Documentation
5179
runs-on: ubuntu-latest
5280
steps:
53-
- uses: actions/checkout@v2
81+
- uses: actions/checkout@v3
5482
- uses: julia-actions/setup-julia@v1
5583
with:
56-
version: '1'
84+
version: "1"
5785
- uses: julia-actions/julia-buildpkg@v1
5886
- uses: julia-actions/julia-docdeploy@v1
5987
env:

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
/docs/build/
22
Manifest.toml
33
log.txt
4+
5+
.vscode/*
6+
7+
# Local History for Visual Studio Code
8+
.history/
9+
10+
# Built Visual Studio Code Extensions
11+
*.vsix

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "AWSCRT"
22
uuid = "df31ea59-17a4-4ebd-9d69-4f45266dc2c7"
3-
version = "0.1.1"
3+
version = "0.1.2"
44

55
[deps]
66
AWSCRT_jll = "01db5350-6ea1-5d9a-9a47-8a31a394cb9c"
@@ -14,4 +14,4 @@ CEnum = "0.4"
1414
CountDownLatches = "2"
1515
ForeignCallbacks = "0.1"
1616
LibAWSCRT = "0.1"
17-
julia = "1.7"
17+
julia = "1.9"

test/runtests.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ end
1717

1818
@testset "AWSCRT" begin
1919
@testset "MQTT pub/sub integration test" begin
20-
topic1 = "test-topic"
20+
topic1 = "test-topic-$(Random.randstring(6))"
2121
payload1 = Random.randstring(48)
22+
client_id1 = Random.randstring(48)
23+
client_id2 = Random.randstring(48)
24+
@show topic1 payload1 client_id1 client_id2
2225
tls_ctx_options = create_client_with_mtls(
2326
ENV["CERT_STRING"],
2427
ENV["PRI_KEY_STRING"],
@@ -42,7 +45,7 @@ end
4245
connection,
4346
ENV["ENDPOINT"],
4447
8883,
45-
Random.randstring(48);
48+
client_id1;
4649
will = Will(topic1, AWS_MQTT_QOS_AT_LEAST_ONCE, "The client has gone offline!", false),
4750
on_connection_interrupted = (conn, error_code) -> begin
4851
@warn "connection interrupted" error_code
@@ -108,7 +111,7 @@ end
108111
connection,
109112
ENV["ENDPOINT"],
110113
8883,
111-
"test-client-id2";
114+
client_id2;
112115
will = Will(topic1, AWS_MQTT_QOS_AT_LEAST_ONCE, "The client has gone offline!", false),
113116
)
114117
@test fetch(task) == Dict(:session_present => false)

test_sysimage/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Manifest.toml
2+
sysimage/sysimage.so

test_sysimage/Project.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name = "Foo"
2+
uuid = "97f99e65-a432-4aef-bc58-bf7726a8fb32"
3+
version = "0.1.0"
4+
5+
[deps]
6+
AWSCRT = "df31ea59-17a4-4ebd-9d69-4f45266dc2c7"
7+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
8+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

test_sysimage/src/Foo.jl

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module Foo
2+
3+
using AWSCRT
4+
using AWSCRT.LibAWSCRT
5+
using Random
6+
using Test
7+
8+
function start()
9+
if ENV["MQTT_ENABLED"] == "true"
10+
tls_ctx_options = create_client_with_mtls(
11+
ENV["CERT_STRING"],
12+
ENV["PRI_KEY_STRING"],
13+
ca_filepath = joinpath(dirname(dirname(@__DIR__)), "test", "certs", "AmazonRootCA1.pem"),
14+
)
15+
tls_ctx = ClientTLSContext(tls_ctx_options)
16+
client = MQTTClient(tls_ctx)
17+
connection = MQTTConnection(client)
18+
client_id = "unknown-client-id-$(Random.randstring(6))"
19+
@show client_id
20+
task = connect(
21+
connection,
22+
ENV["ENDPOINT"],
23+
8883,
24+
client_id;
25+
on_connection_interrupted = (conn, error_code) -> begin
26+
@warn "connection interrupted" error_code
27+
end,
28+
on_connection_resumed = (conn, return_code, session_present) -> begin
29+
@info "connection resumed" return_code session_present
30+
end,
31+
)
32+
resp = fetch(task)
33+
@show resp
34+
if resp != Dict(:session_present => false)
35+
error("connect returned bad response: $resp")
36+
end
37+
end
38+
return nothing
39+
end
40+
41+
end

test_sysimage/sysimage/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[deps]
2+
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using PackageCompiler
2+
3+
function build()
4+
sysimage_path = joinpath(@__DIR__, "sysimage.so")
5+
create_sysimage(
6+
["Foo"];
7+
project = dirname(@__DIR__),
8+
sysimage_path,
9+
# precompile_execution_file = joinpath(@__DIR__, "precompile.jl"),
10+
precompile_statements_file = joinpath(@__DIR__, "precompile_list.jl"),
11+
cpu_target = "generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)",
12+
incremental = true,
13+
include_transitive_dependencies = true,
14+
)
15+
return sysimage_path
16+
end

test_sysimage/sysimage/precompile.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
using Foo
2+
Foo.start()

0 commit comments

Comments
 (0)