From 47875e6465baa2b33641f89139133b87ceed1a2b Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Mon, 5 Jul 2021 15:26:22 +0300 Subject: [PATCH] CI: check Aqua compilation (#7) --- .github/workflows/check.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 18 ++++++++++++++++++ builtin.aqua | 27 +++++++++++++-------------- 3 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..70955aa --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,34 @@ +name: "check-compilation" + +on: + push: + +jobs: + check-compiles: + name: "Check Aqua compiles" + runs-on: ubuntu-latest + defaults: + run: + shell: bash + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-v1-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-v1-node + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: Install aqua compiler + run: npm install -g @fluencelabs/aqua-cli + + - name: Check compilation + run: aqua-cli -i . -o /tmp diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec36c2a..6c09cff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,24 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-v1-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-v1-node + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: Install aqua compiler + run: npm install -g @fluencelabs/aqua-cli + + - name: Check compilation + run: aqua-cli -i . -o /tmp + ### Calculate FINAL_VERSION - name: Install jq run: sudo apt-get update && sudo apt-get --yes --force-yes install jq diff --git a/builtin.aqua b/builtin.aqua index 42040e9..9110c1c 100644 --- a/builtin.aqua +++ b/builtin.aqua @@ -44,14 +44,14 @@ data Module: hash: string config: ModuleConfig -data Blueprint: +data AddBlueprint: name: string dependencies: []Dependency data Blueprint: id: string name: string - dependencies: []string + dependencies: []Dependency data ScriptInfo: id: string @@ -160,13 +160,6 @@ service Srv("srv"): get_interface(service_id: string) -> Interface service Dist("dist"): - -- Used to add modules to the node specified in the service call - -- Arguments: - -- bytes – a base64 string containing the .wasm module to add. - -- config – module info - -- Returns: blake3 hash of the module - add_module(wasm_b56_content: Bytes, conf: ModuleConfig) -> string - -- Constructs a ModuleConfig structure -- Arguments: -- module_name - import name of the module @@ -182,7 +175,14 @@ service Dist("dist"): -- logging_mask - Binary mask to enable & disable logging targets. Targets are -- configured in WasmLoggerBuilder::with_target_map -- mem_pages_count - Maximum memory size accessible by a module in Wasm pages (64 Kb) - make_module_config(name: string, mem_pages_count: ?u32, logger_enabled: ?bool, preopened_files: ?[]string, envs: ?Pairs, mapped_dirs: ?Pairs, mounted_binaries: ?Pairs, logging_mask: ?s32) -> ModuleConfig + make_module_config(name: string, mem_pages_count: ?u32, logger_enabled: ?bool, preopened_files: ?[]string, envs: ?Pairs, mapped_dirs: ?Pairs, mounted_binaries: ?Pairs, logging_mask: ?i32) -> ModuleConfig + + -- Used to add modules to the node specified in the service call + -- Arguments: + -- bytes – a base64 string containing the .wasm module to add. + -- config – module info + -- Returns: blake3 hash of the module + add_module(wasm_b56_content: Bytes, conf: ModuleConfig) -> string -- Get a list of modules available on the node list_modules() -> []Module @@ -190,10 +190,10 @@ service Dist("dist"): -- Get the interface of a module get_interface(module_id: string) -> Interface - -- Add a blueprint to the node - add_blueprint(blueprint: Blueprint) -> string -- Creates Blueprint structure from from blueprint name and dependencies (modules) - make_blueprint(name: string, dependencies: []Dependency) -> Blueprint + make_blueprint(name: string, dependencies: []Dependency) -> AddBlueprint + -- Add a blueprint to the node + add_blueprint(blueprint: AddBlueprint) -> string -- Used to get the blueprints available on the node specified in the service call. -- A blueprint is an object of the following structure @@ -206,7 +206,6 @@ service Script("script"): -- interval - if not set, script will be ran only once -- if set, script will be ran once in the interval -- (NOTE: actual interval may vary by up to 3 seconds) - -- -- TODO: change interval to ?u64 when node API is updated add(air_script: string, interval: ?string) -> string