File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Check
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request : {}
8+
9+ jobs :
10+ check-encodings :
11+ name : Check that the encoding list is up-to-date with KSC
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Check out ksy_schema
16+ uses : actions/checkout@v4
17+ with :
18+ path : ksy_schema
19+ - name : Get list of encodings from ksy_schema
20+ working-directory : ksy_schema
21+ run : |
22+ jq '.definitions.CharacterEncoding.enum' ksy_schema.json > encodings.json
23+
24+ - name : Check out compiler
25+ uses : actions/checkout@v4
26+ with :
27+ repository : kaitai-io/kaitai_struct_compiler
28+ path : compiler
29+ - name : Set up JDK
30+ uses : actions/setup-java@v4
31+ with :
32+ distribution : temurin
33+ java-version : ' 21'
34+ - uses : sbt/setup-sbt@v1
35+ - name : Get list of canonical encodings from KSC
36+ working-directory : compiler
37+ # Written to work with https://github.com/kaitai-io/kaitai_struct_compiler/blob/56582ef65ca869ca43a1691a496bf4989f938675/shared/src/main/scala/io/kaitai/struct/EncodingList.scala
38+ run : |
39+ echo 'java.nio.file.Files.write(java.nio.file.Paths.get("encodings.min.json"), io.kaitai.struct.JSON.stringify(io.kaitai.struct.EncodingList.canonicalToAliasEntries.map(_._1)).getBytes(java.nio.charset.StandardCharsets.UTF_8))' \
40+ | sbt compilerJVM/console
41+ jq . encodings.min.json > encodings.json
42+ rm -f encodings.min.json
43+
44+ - name : Compare encoding lists in ksy_schema and KSC
45+ run : |
46+ git diff --no-index --exit-code -- ksy_schema/encodings.json compiler/encodings.json
You can’t perform that action at this time.
0 commit comments