-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (87 loc) · 3.89 KB
/
Copy pathaot-test.yml
File metadata and controls
101 lines (87 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Ahead-of-time compilation test
on:
pull_request:
branches: [ "main" ]
jobs:
build:
name: AOT test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Only test on Mac and Ubuntu – these are the fastest platforms.
# Windows and Linux ARM are built later after the PR is merged.
os: [macos-14, ubuntu-22.04]
steps:
- uses: actions/checkout@v7
- uses: graalvm/setup-graalvm@v1
with:
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Setup SBT
uses: sbt/setup-sbt@v1
- name: Build native image
env:
DEV_BUILD: true
run: sbt GraalVMNativeImage/packageBin
- name: Test the binary
shell: bash
run: |
set -euo pipefail
# sbt 2 nests build outputs under target/out/<platform>/<scala version>/<project>/
mv target/out/jvm/scala-*/jelly-cli/graalvm-native-image/jelly-cli jelly-cli
# See if it runs at all
./jelly-cli version || exit 1
# Make sure reflection is supported
./jelly-cli version | grep "JVM reflection: supported" \
|| exit 1
# Make sure large RDF/XML file parsing is supported
./jelly-cli version | grep "Large RDF/XML file parsing: supported" \
|| exit 1
# Test RDF conversions
echo '_:b <http://t.org/> _:b .' > in.nt
./jelly-cli \
rdf to-jelly --in-format=nt in.nt > out.jelly && \
[ -s out.jelly ] || exit 1
./jelly-cli \
rdf from-jelly --out-format=jelly-text out.jelly > out.txt && \
[ -s out.txt ] || exit 1
# From jelly-text
./jelly-cli \
rdf to-jelly --in-format=jelly-text out.txt > out2.jelly && \
[ -s out2.jelly ] || exit 1
./jelly-cli \
rdf from-jelly --out-format=jsonld out.jelly > out.json && \
[ -s out.json ] || exit 1
echo '{"@graph":[{"@id":"http://e.org/r","http://e.org/p":{"@value":"v"}}]}' | \
./jelly-cli rdf to-jelly --in-format "jsonld" > jsonld.jelly && \
[ -s jsonld.jelly ] || exit 1
echo '<?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Seq rdf:about="http://example.org/favourite-fruit"></rdf:Seq></rdf:RDF>' | \
./jelly-cli rdf to-jelly --in-format "rdfxml" > rdfxml.jelly && \
[ -s rdfxml.jelly ] || exit 1
# Invalid RDF/XMl input test
# Regression test for: https://github.com/Jelly-RDF/cli/issues/217
echo 'invalidxml' | \
( ! ./jelly-cli rdf to-jelly --in-format "rdfxml" &> error.txt ) && \
grep 'Content is not allowed in prolog' error.txt || exit 1
# Test rdf validate
./jelly-cli \
rdf validate out.jelly --compare-to-rdf-file in.nt || exit 1
# Test SPARQL result set conversions
echo '{"head":{"vars":["a"]},"results":{"bindings":[{"a":{"type":"uri","value":"http://e.org/x"}}]}}' > in.srj
./jelly-cli \
sparql to-jelly in.srj > out.jellys && \
[ -s out.jellys ] || exit 1
./jelly-cli \
sparql from-jelly --out-format=csv out.jellys | grep 'http://e.org/x' || exit 1
# ASK results take a different code path than bindings
echo '{"head":{},"boolean":true}' | \
./jelly-cli sparql to-jelly --in-format=json > ask.jellys && \
[ -s ask.jellys ] || exit 1
./jelly-cli sparql from-jelly ask.jellys | grep 'true' || exit 1
- name: Upload binary
uses: actions/upload-artifact@v7
with:
name: jelly-cli-${{ matrix.os }}
path: jelly-cli