Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github actions: issue error if mismatch ABAP <> Schema #476

Merged
merged 10 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: Generate Schemas
name: Validate JSON schema

on:
pull_request:

jobs:
generate:
validate:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Run
- name: Build
run: |
cd generate
npm ci
npm test
npm run compile
- name: Check Schemas
run: |
cd generate
npm run generate
1 change: 1 addition & 0 deletions generate/abap_transpile.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"ignoreSyntaxCheck": false,
"addFilenames": true,
"addCommonJS": true,
"keywords": ["in", "default"],
"unknownTypes": "runtimeError",
"extraSetup": "../setup.mjs",
"skip": []
Expand Down
10 changes: 5 additions & 5 deletions generate/aff.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async function run() {
}
}

let error = false;
for (const type of types) {
console.log(type);
if (type === "ENHO") {
Expand All @@ -32,16 +33,15 @@ async function run() {
if (output.toString().length > 0) {
console.log(command);
console.log(output.toString());
error = true;
} else {
console.log("\tOK\n");
}
}

// only run for INTF,
/*
const result = await abap.Classes["CL_RUN"].run({object_type: new abap.types.String().set("INTF")});
fs.writeFileSync("generated" + path.sep + "intf-v1.json", result.get());
*/
if (error === true) {
exit(1);
}
}

run();
42 changes: 21 additions & 21 deletions generate/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions generate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"pull": "oras-pull ghcr.io/sap/abap-file-formats-tools/abap-file-formats-tools:latest",
"copy": "cp ../file-formats/*.abap downport && cp ../file-formats/*/type/*.abap downport && cp cl_run.clas.abap downport",
"transpile": "rm -rf output && abap_transpile abap_transpile.json",
"compile": "rm -rf downport && npm run pull && npm run copy && npm run transpile",
"generate": "rm -rf generated && node aff.mjs",
"test": "rm -rf downport && npm run pull && npm run copy && npm run transpile && npm run generate"
"test": "npm run compile && npm run generate"
},
"repository": {
"type": "git",
Expand All @@ -22,8 +23,8 @@
"homepage": "https://github.com/SAP/abap-file-formats#readme",
"dependencies": {
"oras-pull": "^0.1.4",
"@abaplint/runtime": "^2.3.117",
"@abaplint/database-sqlite": "^2.3.111",
"@abaplint/transpiler-cli": "^2.3.117"
"@abaplint/runtime": "^2.3.127",
"@abaplint/database-sqlite": "^2.3.127",
"@abaplint/transpiler-cli": "^2.3.127"
}
}