Add CIs to release new version and publish binary files (#1648)

Add CIs to enable the release process of a new version of WAMR,
and build and publish the binary files when a version is released,
including iwasm, wamrc, lldb, vscode-extension and wamr-ide for
Ubuntu-20.04, Ubuntu-22.04 and MacOS.

And refine the CIs to test spec cases.
This commit is contained in:
Wenyong Huang
2022-10-28 13:55:41 +08:00
committed by GitHub
parent 77ff7daaf4
commit 84161fe084
28 changed files with 1936 additions and 608 deletions

View File

@ -0,0 +1,60 @@
#!/usr/bin/env python3
#
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
"""
Extract the latest release notes content from RELEASE_NOTES.md
"""
import argparse
import os
import sys
import traceback
def latest_content(release_notes_path):
"""
can't change the format of the original content
"""
content = ""
start_extract = False
with open(release_notes_path, encoding="utf-8") as f:
for line in f:
if line.startswith("## "):
if start_extract:
break
start_extract = True
continue
# hit a separated line
if line.startswith("---"):
break
content += line
content += os.linesep
return content
def main():
"""
GO!GO!!GO!!!
"""
parser = argparse.ArgumentParser(description="run the sample and examine outputs")
parser.add_argument("release_notes_path", type=str)
args = parser.parse_args()
ret = 1
try:
print(latest_content(args.release_notes_path))
ret = 0
except AssertionError:
traceback.print_exc()
return ret
if __name__ == "__main__":
sys.exit(main())

View File

@ -0,0 +1,123 @@
#!/usr/bin/env python3
#
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
import re
import shlex
import subprocess
import sys
def fetch_version_from_code():
"""
search the semantic version definition in build-scripts/config_common.cmake
"""
major, minor, patch = "", "", ""
with open("core/version.h", encoding="utf-8") as f:
for line in f:
if "WAMR_VERSION" not in line:
continue
major_match = re.search(r"WAMR_VERSION_MAJOR (\d+)", line)
if major_match is not None:
major = major_match.groups()[0]
continue
minor_match = re.search(r"WAMR_VERSION_MINOR (\d+)", line)
if minor_match is not None:
minor = minor_match.groups()[0]
continue
patch_match = re.search(r"WAMR_VERSION_PATCH (\d+)", line)
if patch_match is not None:
patch = patch_match.groups()[0]
if len(major) == 0 or len(minor) == 0 or len(patch) == 0:
raise Exception(
"can't find the semantic version definition likes WAMR_VERSION_*"
)
return f"WAMR-{major}.{minor}.{patch}"
def fetch_latest_git_tag():
list_tag_cmd = (
'git tag --list WAMR-*.*.* --sort=committerdate --format="%(refname:short)"'
)
p = subprocess.run(shlex.split(list_tag_cmd), capture_output=True, check=True)
all_tags = p.stdout.decode().strip()
latest_tag = all_tags.split("\n")[-1]
return latest_tag
def match_version_pattern(v):
pattern = r"WAMR-\d+\.\d+\.\d+"
m = re.match(pattern, v)
return m is not None
def split_version_string(v):
"""
return the semantic version as an integer list
"""
pattern = r"WAMR-(\d+)\.(\d+)\.(\d+)"
m = re.match(pattern, v)
return [int(x) for x in m.groups()]
def compare_version_string(v1, v2):
"""
return value:
- 1. if v1 > v2
- -1. if v1 < v2
- 0. if v1 == v2
"""
if not match_version_pattern(v1):
raise Exception(f"{v1} doesn't match the version pattern")
if not match_version_pattern(v2):
raise Exception(f"{v2} doesn't match the version pattern")
v1_sem_ver = split_version_string(v1)
v2_sem_ver = split_version_string(v2)
return 0 if v1_sem_ver == v2_sem_ver else (1 if v1_sem_ver > v2_sem_ver else -1)
def is_major_or_minor_changed(v1, v2):
"""
return true if change either major of v2 or minor of v2
return false or else
"""
if not match_version_pattern(v1):
raise Exception(f"{v1} doesn't match the version pattern")
if not match_version_pattern(v2):
raise Exception(f"{v2} doesn't match the version pattern")
v1_major, v1_minor, _ = split_version_string(v1)
v2_major, v2_minor, _ = split_version_string(v2)
return v2_major != v1_major or v2_minor != v1_minor
def next_version():
definition = fetch_version_from_code()
tag = fetch_latest_git_tag()
new_version = ""
minor_changed = False
if compare_version_string(definition, tag) == 1:
new_version = definition.split("-")[-1]
if is_major_or_minor_changed(tag, definition):
minor_changed = True
return new_version, "major_minor_change" if minor_changed else "patch_change"
if __name__ == "__main__":
print(f"{next_version()[0]},{next_version()[1]}")
sys.exit(0)

View File

@ -0,0 +1,102 @@
#!/usr/bin/env python3
#
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
import argparse
import json
import os
import shlex
import subprocess
import sys
from urllib.error import HTTPError, URLError
import urllib.request
def get_last_commit(target_path, cwd):
last_commit_cmd = f"git log -n 1 --pretty=format:%H -- {target_path}"
p = subprocess.run(
shlex.split(last_commit_cmd), capture_output=True, check=True, cwd=cwd
)
return p.stdout.decode().strip()
def fetch_git_tags():
list_tag_cmd = (
'git tag --list WAMR-*.*.* --sort=committerdate --format="%(refname:short)"'
)
p = subprocess.run(shlex.split(list_tag_cmd), capture_output=True, check=True)
all_tags = p.stdout.decode().strip()
return all_tags.split("\n")
def download_binaries(binary_name_stem, cwd):
"""
1. find the latest release name
2. form assets download url:
"""
try:
all_tags = fetch_git_tags()
# *release_process.yml* will create a tag and release at first
second_last_tag = all_tags[-2]
latest_tag = all_tags[-1]
latest_url = "https://api.github.com/repos/bytecodealliance/wasm-micro-runtime/releases/latest"
print(f"::notice::query the latest release with {latest_url}...")
with urllib.request.urlopen(latest_url) as response:
body = response.read()
release_name = json.loads(body)["name"]
# WAMR-X.Y.Z -> X.Y.Z
second_last_sem_ver = second_last_tag[5:]
latest_sem_ver = latest_tag[5:]
assert latest_sem_ver in binary_name_stem
name_stem_in_release = binary_name_stem.replace(
latest_sem_ver, second_last_sem_ver
)
# download and rename
for file_ext in (".zip", ".tar.gz"):
assets_url = f"https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/{release_name}/{name_stem_in_release}{file_ext}"
local_path = f"{binary_name_stem}{file_ext}"
print(f"::notice::download from {assets_url} and save as {local_path}...")
urllib.request.urlretrieve(assets_url, local_path)
return True
except HTTPError as error:
print(error.status, error.reason)
except URLError as error:
print(error.reason)
except TimeoutError:
print("Request timeout")
return False
def main():
parser = argparse.ArgumentParser(
description="Reuse binaries of the latest release if no more modification on the_path since last_commit"
)
parser.add_argument("working_directory", type=str)
parser.add_argument("--binary_name_stem", type=str)
parser.add_argument("--last_commit", type=str)
parser.add_argument("--the_path", type=str)
args = parser.parse_args()
last_commit = get_last_commit(args.the_path, args.working_directory)
if last_commit == args.last_commit:
return download_binaries(args.binary_name_stem, args.working_directory)
else:
return False
if __name__ == "__main__":
# use output to indicate results
# echo "result=${result}" >> "$GITHUB_OUTPUT"
with open(os.environ.get("GITHUB_OUTPUT"), 'a') as output_file:
output_file.write("result=hit\n" if main() else "result=not-hit\n")
# always return 0
sys.exit(0)

View File

@ -0,0 +1,48 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Create and publish Docker images
on:
workflow_call:
inputs:
ver_num:
description: a semantic version number.
type: string
required: true
jobs:
build-and-push-images:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Downcase github actor
id: downcase_github_actor
uses: ASzc/change-string-case-action@v2
with:
string: ${{ github.actor }}
- name: Login to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ steps.downcase_github_actor.outputs.lowercase }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image(wasm-toolchain:${{ inputs.ver_num }}) to Container registry
run: |
docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }} .
docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }}
working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
- name: Build and push Docker image(wasm-debug-server:${{ inputs.ver_num }}) to Container registry
run: |
docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }} .
docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }}
working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker

View File

@ -0,0 +1,90 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: build iwasm release
on:
workflow_call:
inputs:
arch:
description: arch of the release
type: string
required: false
default: x86_64
cwd:
description: workfing directory
type: string
required: true
runner:
description: OS of compilation
type: string
required: true
upload_url:
description: a semantic version number. it is required when `release` is true.
type: string
required: false
ver_num:
description: a semantic version number. it is required when `release` is true.
type: string
required: false
jobs:
build:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v3
- name: generate iwasm binary release
run: |
cmake -S . -B build \
-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 \
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
-DWAMR_BUILD_DEBUG_INTERP=0 \
-DWAMR_BUILD_DEBUG_AOT=0 \
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
-DWAMR_BUILD_LIBC_UVWASI=0 \
-DWAMR_BUILD_LIBC_EMCC=0 \
-DWAMR_BUILD_LIB_RATS=0 \
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
-DWAMR_BUILD_MEMORY_PROFILING=0 \
-DWAMR_BUILD_MINI_LOADER=0 \
-DWAMR_BUILD_MULTI_MODULE=0 \
-DWAMR_BUILD_PERF_PROFILING=0 \
-DWAMR_BUILD_SPEC_TEST=0 \
-DWAMR_BUILD_BULK_MEMORY=1 \
-DWAMR_BUILD_LIB_PTHREAD=1 \
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
-DWAMR_BUILD_LIBC_BUILTIN=1 \
-DWAMR_BUILD_LIBC_WASI=1 \
-DWAMR_BUILD_REF_TYPES=1 \
-DWAMR_BUILD_SIMD=1 \
-DWAMR_BUILD_SHARED_MEMORY=1 \
-DWAMR_BUILD_TAIL_CALL=1 \
-DWAMR_BUILD_THREAD_MGR=1
cmake --build build --config Release --parallel 4
working-directory: ${{ inputs.cwd }}
- name: compress the binary
run: |
tar czf iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
zip iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip iwasm
working-directory: ${{ inputs.cwd }}/build
- name: upload release tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ inputs.cwd }}/build/iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
asset_name: iwasm-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ inputs.cwd }}/build/iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
asset_name: iwasm-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
asset_content_type: application/zip

View File

@ -0,0 +1,39 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Reusable workflow-build_llvm_libraries
on:
workflow_call:
inputs:
runs-on:
required: true
type: string
jobs:
build_llvm_libraries:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ${{ fromJson(inputs.runs-on) }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: Cache LLVM libraries
id: cache_llvm
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ${{ matrix.os }}-build-llvm_libraries_ex
- name: Build llvm
id: build_llvm
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly
working-directory: build-scripts

181
.github/workflows/build_wamr_lldb.yml vendored Normal file
View File

@ -0,0 +1,181 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: build wamr lldb
on:
workflow_call:
inputs:
arch:
description: arch of the release
type: string
required: false
default: x86_64
runner:
description: OS of compilation
type: string
required: true
upload_url:
description: upload binary assets to the URL of release
type: string
required: true
ver_num:
description: a semantic version number
type: string
required: true
jobs:
try_reuse:
uses: ./.github/workflows/reuse_latest_release_binaries.yml
with:
binary_name_stem: "wamr-lldb-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}"
last_commit: "ea63ba4bd010c2285623ad4acc0262a4d63bcfea"
the_path: "./build-scripts/lldb-wasm.patch"
upload_url: ${{ inputs.upload_url }}
build:
needs: try_reuse
if: needs.try_reuse.outputs.result != 'hit'
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v3
- name: Cache build
id: lldb_build_cache
uses: actions/cache@v3
with:
path: |
./core/deps/llvm-project/build/bin
./core/deps/llvm-project/build/include
./core/deps/llvm-project/build/lib
./core/deps/llvm-project/build/libexec
./core/deps/llvm-project/build/share
./core/deps/llvm-project/lldb/tools/
./core/deps/llvm-project/inst/
key: ${{inputs.arch}}-${{ inputs.runner }}-lldb_build
- name: setup xcode macos
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'macos')
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
# Remove xCode command line tools, to prevent duplicate symbol compilation failures
- name: install utils macos
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'macos')
run: |
brew install swig cmake ninja libedit
sudo rm -rf /Library/Developer/CommandLineTools
- name: intsall utils ubuntu
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'ubuntu')
run: sudo apt update && sudo apt-get install -y lld ninja-build
# `git clone` takes ~7m
- name: download llvm
if: steps.lldb_build_cache.outputs.cache-hit != 'true'
run: |
wget https://github.com/llvm/llvm-project/archive/1f27fe6128769f00197925c3b8f6abb9d0e5cd2e.zip
unzip -q 1f27fe6128769f00197925c3b8f6abb9d0e5cd2e.zip
mv llvm-project-1f27fe6128769f00197925c3b8f6abb9d0e5cd2e llvm-project
working-directory: core/deps/
- name: apply wamr patch
if: steps.lldb_build_cache.outputs.cache-hit != 'true'
run: |
git init
git config user.email "action@github.com"
git config user.name "github action"
git apply ../../../build-scripts/lldb-wasm.patch
working-directory: core/deps/llvm-project
- name: build lldb ubuntu
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'ubuntu')
run: |
echo "start to build lldb..."
mkdir -p inst
cmake -S ./llvm -B build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=../inst \
-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb" \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_BUILD_BENCHMARKS:BOOL=OFF \
-DLLVM_BUILD_DOCS:BOOL=OFF -DLLVM_BUILD_EXAMPLES:BOOL=OFF \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF -DLLVM_BUILD_TESTS:BOOL=OFF \
-DLLVM_ENABLE_BINDINGS:BOOL=OFF -DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF \
-DLLVM_INCLUDE_DOCS:BOOL=OFF -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \
-DLLVM_INCLUDE_TESTS:BOOL=OFF -DLLVM_ENABLE_LLD:BOOL=ON
cmake --build build --target lldb install --parallel $(nproc)
working-directory: core/deps/llvm-project
- name: build lldb macos
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'macos')
run: |
echo "start to build lldb..."
mkdir -p inst
cmake -S ./llvm -B build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=../inst \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLLVM_ENABLE_PROJECTS="clang;lldb" \
-DLLVM_INCLUDE_TESTS:BOOL=OFF \
-DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \
-DLLVM_BUILD_BENCHMARKS:BOOL=OFF \
-DLLVM_BUILD_DOCS:BOOL=OFF \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \
-DLLVM_ENABLE_BINDINGS:BOOL=OFF \
-DLLVM_TARGETS_TO_BUILD:STRING="X86;WebAssembly" \
-DLLVM_ENABLE_LIBXML2:BOOL=ON \
-DLLDB_ENABLE_PYTHON:BOOL=OFF \
-DLLDB_BUILD_FRAMEWORK:BOOL=OFF
cmake --build build --target lldb install --parallel $(nproc)
working-directory: core/deps/llvm-project
- name: pack a distribution
if: steps.lldb_build_cache.outputs.cache-hit != 'true'
run: |
mkdir -p inst/bin
mkdir -p inst/lib
cp build/bin/lldb* inst/bin
cp lldb/tools/lldb-vscode/package.json inst
cp -r lldb/tools/lldb-vscode/syntaxes/ inst
working-directory: core/deps/llvm-project
- name: pack ubuntu specific libraries
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'ubuntu')
run: |
cp build/lib/liblldb*.so inst/lib
cp build/lib/liblldb*.so.* inst/lib
working-directory: core/deps/llvm-project
- name: pack macos specific libraries
if: steps.lldb_build_cache.outputs.cache-hit != 'true' && contains(inputs.runner, 'macos')
run: |
cp build/lib/liblldb*.dylib inst/lib
working-directory: core/deps/llvm-project
- name: compress the binary
run: |
tar czf wamr-lldb-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz inst
zip -r wamr-lldb-${{ inputs.ver_num }}-${{ inputs.runner }}.zip inst
working-directory: core/deps/llvm-project
- name: upload release tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: core/deps/llvm-project/wamr-lldb-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
asset_name: wamr-lldb-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: core/deps/llvm-project/wamr-lldb-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
asset_name: wamr-lldb-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
asset_content_type: application/zip

78
.github/workflows/build_wamr_sdk.yml vendored Normal file
View File

@ -0,0 +1,78 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: build wamr-sdk
on:
workflow_call:
inputs:
arch:
description: arch of the release
type: string
required: false
default: x86_64
config_file:
description: warm-sdk config file path
type: string
required: true
runner:
description: OS of compilation
type: string
required: true
upload_url:
description: upload binary assets to the URL of release
type: string
required: true
ver_num:
description: a semantic version number
type: string
required: true
wasi_sdk_url:
description: download WASI_SDK from this URL
type: string
required: true
jobs:
build:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v3
- name: download and install wasi-sdk
run: |
cd /opt
basename=$(basename ${{ inputs.wasi_sdk_url }})
sudo wget --progress=dot:giga ${{ inputs.wasi_sdk_url }}
sudo tar -xzf ${basename}
sudo rm ${basename}
sudo mv wasi-sdk-* wasi-sdk
- name: generate wamr-sdk release
run: |
./build_sdk.sh -n wamr-sdk -x $(pwd)/${{ inputs.config_file }}
working-directory: wamr-sdk
- name: compress the binary
run: |
tar czf wamr-sdk-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamr-sdk
zip -r wamr-sdk-${{ inputs.ver_num }}-${{ inputs.runner }}.zip wamr-sdk
working-directory: wamr-sdk/out
- name: upload release tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: wamr-sdk/out/wamr-sdk-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
asset_name: wamr-sdk-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: wamr-sdk/out/wamr-sdk-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
asset_name: wamr-sdk-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
asset_content_type: application/zip

View File

@ -0,0 +1,66 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: build wamr-ide vscode extension
on:
workflow_call:
inputs:
upload_url:
description: upload binary assets to the URL of release
type: string
required: true
ver_num:
description: a semantic version number.
type: string
required: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: set vscode extension to correct version
run: |
npm install -g json
json -I -f package.json -e "this.version=\"${{ inputs.ver_num }}\""
working-directory: test-tools/wamr-ide/VSCode-Extension
- name: generate wamr ide vscode extension
run: |
npm install -g vsce
rm -rf node_modules
npm install
vsce package
working-directory: test-tools/wamr-ide/VSCode-Extension
- name: compress the vscode extension
run: |
tar czf wamr_ide-${{ inputs.ver_num }}.tar.gz wamride-*.vsix
zip wamr_ide-${{ inputs.ver_num }}.zip wamride-*.vsix
working-directory: test-tools/wamr-ide/VSCode-Extension
- name: upload release tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: test-tools/wamr-ide/VSCode-Extension/wamr_ide-${{ inputs.ver_num }}.tar.gz
asset_name: wamr_ide-${{ inputs.ver_num }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: test-tools/wamr-ide/VSCode-Extension/wamr_ide-${{ inputs.ver_num }}.zip
asset_name: wamr_ide-${{ inputs.ver_num }}.zip
asset_content_type: application/zip

90
.github/workflows/build_wamrc.yml vendored Normal file
View File

@ -0,0 +1,90 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: build wamrc
on:
workflow_call:
inputs:
arch:
description: arch of the release
type: string
required: false
default: x86_64
llvm_cache_key:
description: the cache key of llvm libraries
type: string
required: true
release:
description: it is a part of the release process
type: boolean
required: true
runner:
description: OS of compilation
type: string
required: true
upload_url:
description: a semantic version number. it is required when `release` is true.
type: string
required: false
ver_num:
description: a semantic version number. it is required when `release` is true.
type: string
required: false
jobs:
build:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v3
- name: get cached LLVM libraries
id: cache_llvm
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ${{ inputs.llvm_cache_key }}
- name: Build llvm and clang from source
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: /usr/bin/env python3 ./build_llvm.py --arch X86
working-directory: build-scripts
- name: generate wamrc binary release
run: |
cmake -S . -B build
cmake --build build --config Release --parallel 4
working-directory: wamr-compiler
- name: compress the binary
if: inputs.release
run: |
tar czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
zip wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip wamrc
working-directory: wamr-compiler/build
- name: upload release tar.gz
if: inputs.release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: wamr-compiler/build/wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
asset_name: wamrc-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
if: inputs.release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: wamr-compiler/build/wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
asset_name: wamrc-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
asset_content_type: application/zip

View File

@ -15,18 +15,7 @@ concurrency:
cancel-in-progress: true
jobs:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
cancel_previous:
runs-on: ubuntu-latest
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
complinace_job:
needs: cancel_previous
runs-on: ubuntu-latest
steps:
- name: checkout

View File

@ -6,20 +6,36 @@ name: compilation on android, ubuntu-20.04, ubuntu-22.04
on:
# will be triggered on PR events
pull_request:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
- ".github/workflows/compilation_on_android_ubuntu.yml"
types:
- opened
- synchronize
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# will be triggered on push events
push:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
- ".github/workflows/compilation_on_android_ubuntu.yml"
branches:
- main
- "dev/**"
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# allow to be triggered manually
workflow_dispatch:
@ -34,8 +50,8 @@ env:
AOT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
FAST_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
LLVM_LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
# LLVM
LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
# For Spec Test
@ -46,112 +62,23 @@ env:
X86_32_TARGET_TEST_OPTIONS: "-m x86_32 -P"
jobs:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
cancel_previous:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
# set different traffic lights based on the current repo and the running OS.
# according to light colors, the workflow will run different jobs
# it is used to separate between the public repo and the private repo
check_repo:
needs: cancel_previous
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
outputs:
traffic_light_on_ubuntu_2004: ${{ steps.do_check_on_ubuntu_2004.outputs.light }}
traffic_light_on_ubuntu_2204: ${{ steps.do_check_on_ubuntu_2204.outputs.light }}
steps:
- name: do_check_on_ubuntu_2004
id: do_check_on_ubuntu_2004
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
echo "::set-output name=light::green"
else
echo "::set-output name=light::red"
fi
- name: do_check_on_ubuntu_2204
id: do_check_on_ubuntu_2204
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
echo "::set-output name=light::green"
else
echo "::set-output name=light::green"
fi
build_llvm_libraries:
needs: check_repo
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
- os: ubuntu-22.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Cache LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Build llvm and clang from source
id: build_llvm
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly --project clang lldb
working-directory: build-scripts
uses: ./.github/workflows/build_llvm_libraries.yml
with:
runs-on: "['ubuntu-20.04', 'ubuntu-22.04']"
build_wamrc:
needs: [build_llvm_libraries, check_repo]
needs: [build_llvm_libraries]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
- os: ubuntu-22.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Get LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v3
with:
path: |
@ -163,11 +90,10 @@ jobs:
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Build wamrc
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake ..
@ -175,7 +101,7 @@ jobs:
working-directory: wamr-compiler
build_iwasm:
needs: [build_llvm_libraries, check_repo]
needs: [build_llvm_libraries]
runs-on: ${{ matrix.os }}
strategy:
matrix:
@ -184,8 +110,8 @@ jobs:
$AOT_BUILD_OPTIONS,
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
$LLVM_EAGER_JIT_BUILD_OPTIONS,
$LLVM_LAZY_JIT_BUILD_OPTIONS,
$LLVM_EAGER_JIT_BUILD_OPTIONS,
]
make_options_feature: [
# Features
@ -210,10 +136,10 @@ jobs:
# uncompatiable feature and platform
# uncompatiable mode and feature
# MULTI_MODULE only on INTERP mode
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
# SIMD only on JIT/AOT mode
@ -224,10 +150,10 @@ jobs:
# DEBUG_INTERP only on CLASSIC INTERP mode
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
# DEBUG_AOT only on JIT/AOT mode
@ -236,34 +162,25 @@ jobs:
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
# TODO: DEBUG_AOT on JIT
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
# MINI_LOADER only on INTERP mode
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
- os: ubuntu-22.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
# only download llvm cache when needed
- name: Get LLVM libraries
id: cache_llvm
if: (matrix.light == 'green') && (endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS'))
if: endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS')
uses: actions/cache@v3
with:
path: |
@ -275,11 +192,10 @@ jobs:
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: (matrix.light == 'green') && (endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS')) && (steps.cache_llvm.outputs.cache-hit != 'true')
if: endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS') && (steps.cache_llvm.outputs.cache-hit != 'true')
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Build iwasm
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
@ -287,39 +203,34 @@ jobs:
working-directory: product-mini/platforms/${{ matrix.platform }}
build_samples_wasm_c_api:
needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
needs: [build_iwasm, build_llvm_libraries, build_wamrc]
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options: [
# Running mode
$AOT_BUILD_OPTIONS,
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
$LLVM_EAGER_JIT_BUILD_OPTIONS,
$LLVM_LAZY_JIT_BUILD_OPTIONS,
$LLVM_EAGER_JIT_BUILD_OPTIONS,
$AOT_BUILD_OPTIONS,
]
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
- os: ubuntu-22.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
wasi_sdk_release:
[
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz",
]
wabt_release:
[
"https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz",
]
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Get LLVM libraries
id: cache_llvm
if: (matrix.light == 'green') && (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
uses: actions/cache@v3
with:
path: |
@ -331,11 +242,10 @@ jobs:
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: (matrix.light == 'green') && (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS')) && (steps.cache_llvm.outputs.cache-hit != 'true')
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS')) && (steps.cache_llvm.outputs.cache-hit != 'true')
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: download and install wabt
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
@ -343,7 +253,7 @@ jobs:
sudo mv wabt-1.0.24 wabt
- name: Build wamrc
if: (matrix.light == 'green') && (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
if: (!endsWith(matrix.make_options, '_INTERP_BUILD_OPTIONS'))
run: |
mkdir build && cd build
cmake ..
@ -351,7 +261,6 @@ jobs:
working-directory: wamr-compiler
- name: Build Sample [wasm-c-api]
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options }}
@ -369,29 +278,24 @@ jobs:
working-directory: samples/wasm-c-api
build_samples_others:
needs: [build_iwasm, check_repo]
needs: [build_iwasm]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
- os: ubuntu-22.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2204 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
os: [ubuntu-20.04, ubuntu-22.04]
wasi_sdk_release:
[
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz",
]
wabt_release:
[
"https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz",
]
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: download and install wasi-sdk
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wasi_sdk_release }}
@ -399,7 +303,6 @@ jobs:
sudo mv wasi-sdk-12.0 wasi-sdk
- name: download and install wabt
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
@ -407,14 +310,12 @@ jobs:
sudo mv wabt-1.0.24 wabt
- name: Build Sample [basic]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/basic
./build.sh
./run.sh
- name: Build Sample [file]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/file
mkdir build && cd build
@ -423,7 +324,6 @@ jobs:
./src/iwasm -f wasm-app/file.wasm -d .
- name: Build Sample [multi-thread]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/multi-thread
mkdir build && cd build
@ -432,7 +332,6 @@ jobs:
./iwasm wasm-apps/test.wasm
- name: Build Sample [multi-module]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/multi-module
mkdir build && cd build
@ -441,7 +340,6 @@ jobs:
./multi_module
- name: Build Sample [spawn-thread]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/spawn-thread
mkdir build && cd build
@ -450,7 +348,6 @@ jobs:
./spawn_thread
- name: Build Sample [ref-types]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/ref-types
mkdir build && cd build
@ -458,57 +355,63 @@ jobs:
cmake --build . --config Release --parallel 4
./hello
spec_test_default:
needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
- name: Build Sample [simple]
run: |
./build.sh -p host-interp
python3 ./sample_test_run.py $(pwd)/out
exit $?
working-directory: ./samples/simple
spec_test:
needs: [build_iwasm, build_llvm_libraries, build_wamrc]
runs-on: ubuntu-20.04
strategy:
matrix:
test_option: [$DEFAULT_TEST_OPTIONS]
steps:
- name: checkout
uses: actions/checkout@v3
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: install Ninja
run: sudo apt install -y ninja-build
- name: run spec tests
run: ./test_wamr.sh ${{ matrix.test_option }}
working-directory: ./tests/wamr-test-suites
spec_test_extra:
if: ${{ endsWith(github.repository, 'wasm-micro-runtime') }}
needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
runs-on: ubuntu-20.04
strategy:
matrix:
running_mode: ["classic-interp", "fast-interp", "jit", "aot"]
running_mode:
["classic-interp", "fast-interp", "jit", "aot", "fast-jit"]
test_option:
[
$DEFAULT_TEST_OPTIONS,
$MULTI_MODULES_TEST_OPTIONS,
$SIMD_TEST_OPTIONS,
$THREADS_TEST_OPTIONS,
]
exclude:
# uncompatiable modes and features
# classic-interp and fast-interp don't support simd
- running_mode: "classic-interp"
test_option: $SIMD_TEST_OPTIONS
- running_mode: "fast-interp"
test_option: $SIMD_TEST_OPTIONS
# aot and jit don't support multi module
- running_mode: "aot"
test_option: $MULTI_MODULES_TEST_OPTIONS
- running_mode: "jit"
test_option: $MULTI_MODULES_TEST_OPTIONS
# fast-jit is only tested on default mode, exclude other three
- running_mode: "fast-jit"
test_option: $MULTI_MODULES_TEST_OPTIONS
- running_mode: "fast-jit"
test_option: $SIMD_TEST_OPTIONS
- running_mode: "fast-jit"
test_option: $THREADS_TEST_OPTIONS
steps:
- name: checkout
uses: actions/checkout@v3
- name: set env variable(if llvm are used)
if: matrix.running_mode == 'aot' || matrix.running_mode == 'jit'
run: echo "USE_LLVM=true" >> $GITHUB_ENV
- name: set env variable(if x86_32 test needed)
if: >
(matrix.test_option == '$DEFAULT_TEST_OPTIONS' || matrix.test_option == '$THREADS_TEST_OPTIONS')
&& matrix.running_mode != 'fast-jit' && matrix.running_mode != 'jit'
run: echo "TEST_ON_X86_32=true" >> $GITHUB_ENV
#only download llvm libraries in jit and aot mode
- name: Get LLVM libraries
if: env.USE_LLVM == 'true'
id: cache_llvm
uses: actions/cache@v3
with:
@ -521,53 +424,28 @@ jobs:
key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
if: env.USE_LLVM == 'true' && steps.cache_llvm.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: install Ninja
run: sudo apt install -y ninja-build
- name: run spec tests
- name: run spec tests default and extra
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
working-directory: ./tests/wamr-test-suites
spec_test_x86_32:
if: ${{ endsWith(github.repository, 'wasm-micro-runtime') }}
needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
runs-on: ubuntu-20.04
strategy:
matrix:
running_mode: ["classic-interp", "fast-interp", "jit", "aot"]
test_option: [$DEFAULT_TEST_OPTIONS, $THREADS_TEST_OPTIONS]
steps:
- name: checkout
uses: actions/checkout@v3
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: install Ninja and x32 support libraries
#only install x32 support libraries when to run x86_32 cases
- name: install x32 support libraries
if: env.TEST_ON_X86_32 == 'true'
run:
# Add another apt repository as some packages cannot
# be downloaded with the github default repository
sudo curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc &&
sudo apt-add-repository https://packages.microsoft.com/ubuntu/20.04/prod &&
sudo apt-get update &&
sudo apt install -y g++-multilib lib32gcc-9-dev ninja-build
sudo apt install -y g++-multilib lib32gcc-9-dev
- name: run spec tests
- name: run spec tests x86_32
if: env.TEST_ON_X86_32 == 'true'
run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
working-directory: ./tests/wamr-test-suites

View File

@ -6,20 +6,36 @@ name: compilation on macos-latest
on:
# will be triggered on PR events
pull_request:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
- ".github/workflows/compilation_on_macos.yml"
types:
- opened
- synchronize
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# will be triggered on push events
push:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
- ".github/workflows/compilation_on_macos.yml"
branches:
- main
- "dev/**"
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# allow to be triggered manually
workflow_dispatch:
@ -30,106 +46,31 @@ concurrency:
cancel-in-progress: true
env:
# For BUILD
AOT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
FAST_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
LLVM_LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
# LLVM
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
jobs:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
cancel_previous:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
# set different traffic lights based on the current repo and the running OS.
# according to light colors, the workflow will run different jobs
check_repo:
needs: cancel_previous
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
outputs:
traffic_light: ${{ steps.do_check.outputs.light }}
steps:
- name: do_check
id: do_check
if: ${{ matrix.os == 'macos-latest' }}
run: |
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
echo "::set-output name=light::green"
else
echo "::set-output name=light::red"
fi
build_llvm_libraries:
needs: check_repo
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
include:
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Cache LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Build llvm and clang from source
id: build_llvm
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly
working-directory: build-scripts
uses: ./.github/workflows/build_llvm_libraries.yml
with:
runs-on: "['macos-latest']"
build_wamrc:
needs: [build_llvm_libraries, check_repo]
needs: [build_llvm_libraries]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
include:
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Get LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v3
with:
path: |
@ -141,11 +82,10 @@ jobs:
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Build wamrc
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake ..
@ -153,7 +93,7 @@ jobs:
working-directory: wamr-compiler
build_iwasm:
needs: [build_llvm_libraries, check_repo]
needs: [build_llvm_libraries]
runs-on: ${{ matrix.os }}
strategy:
matrix:
@ -162,8 +102,8 @@ jobs:
$AOT_BUILD_OPTIONS,
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
$LLVM_EAGER_JIT_BUILD_OPTIONS,
$LLVM_LAZY_JIT_BUILD_OPTIONS,
$LLVM_EAGER_JIT_BUILD_OPTIONS,
]
make_options_feature: [
# Features
@ -189,10 +129,10 @@ jobs:
# uncompatiable feature and platform
# uncompatiable mode and feature
# MULTI_MODULE only on INTERP mode
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
# SIMD only on JIT/AOT mode
@ -203,10 +143,10 @@ jobs:
# DEBUG_INTERP only on CLASSIC INTERP mode
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
# DEBUG_AOT only on JIT/AOT mode
@ -215,32 +155,25 @@ jobs:
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
# TODO: DEBUG_AOT on JIT
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
# MINI_LOADER only on INTERP mode
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
include:
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light }}
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
# only download llvm cache when needed
- name: Get LLVM libraries
id: cache_llvm
if: (matrix.light == 'green') && (endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS'))
if: endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS')
uses: actions/cache@v3
with:
path: |
@ -252,11 +185,10 @@ jobs:
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: (matrix.light == 'green') && (endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS')) && (steps.cache_llvm.outputs.cache-hit != 'true')
if: endsWith(matrix.make_options_run_mode, '_JIT_BUILD_OPTIONS') && (steps.cache_llvm.outputs.cache-hit != 'true')
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Build iwasm
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
@ -264,35 +196,27 @@ jobs:
working-directory: product-mini/platforms/${{ matrix.platform }}
build_samples_wasm_c_api:
needs: [build_iwasm, check_repo]
needs: [build_iwasm]
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options: [
# Running mode
# Running modes supported
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
# doesn't support
#$AOT_BUILD_OPTIONS,
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
# Running modes unsupported
#$LLVM_LAZY_JIT_BUILD_OPTIONS,
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
#$AOT_BUILD_OPTIONS,
]
os: [macos-latest]
include:
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz
wasi_sdk_release: ["https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz"]
wabt_release: ["https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz"]
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: download and install wabt
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
@ -300,7 +224,6 @@ jobs:
sudo mv wabt-1.0.24 wabt
- name: Build Sample [wasm-c-api]
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options }}
@ -318,25 +241,18 @@ jobs:
working-directory: samples/wasm-c-api
build_samples_others:
needs: [build_iwasm, check_repo]
needs: [build_iwasm]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz
os: [macos-latest]
wasi_sdk_release: ["https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz"]
wabt_release: ["https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz"]
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: download and install wasi-sdk
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wasi_sdk_release }}
@ -344,7 +260,6 @@ jobs:
sudo mv wasi-sdk-12.0 wasi-sdk
- name: download and install wabt
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
@ -352,14 +267,12 @@ jobs:
sudo mv wabt-1.0.24 wabt
- name: Build Sample [basic]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/basic
./build.sh
./run.sh
- name: Build Sample [file]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/file
mkdir build && cd build
@ -368,7 +281,6 @@ jobs:
./src/iwasm -f wasm-app/file.wasm -d .
- name: Build Sample [multi-thread]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/multi-thread
mkdir build && cd build
@ -377,7 +289,6 @@ jobs:
./iwasm wasm-apps/test.wasm
- name: Build Sample [multi-module]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/multi-module
mkdir build && cd build
@ -386,7 +297,6 @@ jobs:
./multi_module
- name: Build Sample [spawn-thread]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/spawn-thread
mkdir build && cd build
@ -395,7 +305,6 @@ jobs:
./spawn_thread
- name: Build Sample [ref-types]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/ref-types
mkdir build && cd build

View File

@ -6,18 +6,36 @@ name: compilation on nuttx
on:
# will be triggered on PR events
pull_request:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
types:
- opened
- synchronize
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# will be triggered on push events
push:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
branches:
- main
- "dev/**"
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# allow to be triggered manually
workflow_dispatch:
@ -28,21 +46,11 @@ concurrency:
cancel-in-progress: true
jobs:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
cancel_previous:
runs-on: ubuntu-22.04
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
build_iwasm_on_nuttx:
runs-on: ubuntu-22.04
strategy:
matrix:
nuttx_board_config : [
nuttx_board_config: [
# x64
"boards/sim/sim/sim/configs/nsh",
# cortex-m0
@ -72,17 +80,17 @@ jobs:
steps:
- name: Install Utilities
run: |
run: |
sudo apt install -y kconfig-frontends-nox genromfs
pip3 install pyelftools
pip3 install cxxfilt
- name: Install ARM Compilers
if: ${{ contains(matrix.nuttx_board_config, 'arm') }}
if: contains(matrix.nuttx_board_config, 'arm')
run: sudo apt install -y gcc-arm-none-eabi
- name: Install RISC-V Compilers
if: ${{ contains(matrix.nuttx_board_config, 'risc-v') }}
if: contains(matrix.nuttx_board_config, 'risc-v')
run: sudo apt install -y gcc-riscv64-unknown-elf
- name: Checkout NuttX
@ -104,7 +112,7 @@ jobs:
path: apps/interpreters/wamr/wamr
- name: Enable WAMR for NuttX
run: |
run: |
find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_CR=y\n${{ matrix.wamr_config_option }}'
find nuttx/boards/sim -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
find nuttx/boards/risc-v -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'

View File

@ -6,20 +6,36 @@ name: compilation on SGX
on:
# will be triggered on PR events
pull_request:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
- ".github/workflows/compilation_on_sgx.yml"
types:
- opened
- synchronize
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# will be triggered on push events
push:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
- ".github/workflows/compilation_on_sgx.yml"
branches:
- main
- "dev/**"
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# allow to be triggered manually
workflow_dispatch:
@ -30,99 +46,31 @@ concurrency:
cancel-in-progress: true
env:
# For BUILD
AOT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
FAST_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
LLVM_LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
# LLVM
LLVM_EAGER_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
jobs:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
cancel_previous:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
# set different traffic lights based on the current repo and the running OS.
# according to light colors, the workflow will run different jobs
check_repo:
needs: cancel_previous
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
outputs:
traffic_light_on_ubuntu_2004: ${{ steps.do_check_on_ubuntu_2004.outputs.light }}
steps:
- name: do_check_on_ubuntu_2004
id: do_check_on_ubuntu_2004
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
echo "::set-output name=light::green"
else
echo "::set-output name=light::green"
fi
build_llvm_libraries:
needs: check_repo
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Cache LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Build llvm and clang from source
id: build_llvm
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly --project clang lldb
working-directory: build-scripts
uses: ./.github/workflows/build_llvm_libraries.yml
with:
runs-on: "['ubuntu-20.04']"
build_iwasm:
needs: [check_repo]
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options_run_mode: [
# Running mode
# Running modes supported
$AOT_BUILD_OPTIONS,
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
# doesn't support
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
# Running modes unsupported
#$LLVM_LAZY_JIT_BUILD_OPTIONS,
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
]
make_options_feature: [
# Features
@ -154,15 +102,8 @@ jobs:
# MINI_LOADER only on INTERP mode
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: install SGX SDK and necessary libraries
if: ${{ matrix.light == 'green' }}
run: |
mkdir -p /opt/intel
cd /opt/intel
@ -176,11 +117,9 @@ jobs:
source /opt/intel/sgxsdk/environment
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Build iwasm
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
@ -188,20 +127,13 @@ jobs:
working-directory: product-mini/platforms/${{ matrix.platform }}
build_wamrc:
needs: [build_llvm_libraries, check_repo]
needs: [build_llvm_libraries]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: install SGX SDK and necessary libraries
if: ${{ matrix.light == 'green' }}
run: |
mkdir -p /opt/intel
cd /opt/intel
@ -215,12 +147,10 @@ jobs:
source /opt/intel/sgxsdk/environment
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Get LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v3
with:
path: |
@ -232,11 +162,10 @@ jobs:
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Build wamrc
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake ..
@ -244,35 +173,27 @@ jobs:
working-directory: wamr-compiler
build_samples_wasm_c_api:
needs: [build_iwasm, check_repo]
needs: [build_iwasm]
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options: [
# Running mode
# Running modes supported
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
# doesn't support
#$AOT_BUILD_OPTIONS,
# Running modes unsupported
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
#$LLVM_LAZY_JIT_BUILD_OPTIONS,
#$AOT_BUILD_OPTIONS,
]
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
wasi_sdk_release: ["https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz"]
wabt_release: ["https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz"]
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: download and install wabt
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
@ -280,7 +201,6 @@ jobs:
sudo mv wabt-1.0.24 wabt
- name: install SGX SDK and necessary libraries
if: ${{ matrix.light == 'green' }}
run: |
mkdir -p /opt/intel
cd /opt/intel
@ -294,7 +214,6 @@ jobs:
source /opt/intel/sgxsdk/environment
- name: Build Sample [wasm-c-api]
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options }}
@ -312,25 +231,18 @@ jobs:
working-directory: samples/wasm-c-api
build_samples_others:
needs: [build_iwasm, check_repo]
needs: [build_iwasm]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
os: [ubuntu-20.04]
wasi_sdk_release: ["https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz"]
wabt_release: ["https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz"]
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: download and install wasi-sdk
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wasi_sdk_release }}
@ -338,7 +250,6 @@ jobs:
sudo mv wasi-sdk-12.0 wasi-sdk
- name: download and install wabt
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
@ -346,7 +257,6 @@ jobs:
sudo mv wabt-1.0.24 wabt
- name: install SGX SDK and necessary libraries
if: ${{ matrix.light == 'green' }}
run: |
mkdir -p /opt/intel
cd /opt/intel
@ -360,14 +270,12 @@ jobs:
source /opt/intel/sgxsdk/environment
- name: Build Sample [basic]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/basic
./build.sh
./run.sh
- name: Build Sample [file]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/file
mkdir build && cd build
@ -376,7 +284,6 @@ jobs:
./src/iwasm -f wasm-app/file.wasm -d .
- name: Build Sample [multi-thread]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/multi-thread
mkdir build && cd build
@ -385,7 +292,6 @@ jobs:
./iwasm wasm-apps/test.wasm
- name: Build Sample [multi-module]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/multi-module
mkdir build && cd build
@ -394,7 +300,6 @@ jobs:
./multi_module
- name: Build Sample [spawn-thread]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/spawn-thread
mkdir build && cd build
@ -403,7 +308,6 @@ jobs:
./spawn_thread
- name: Build Sample [ref-types]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/ref-types
mkdir build && cd build
@ -412,22 +316,25 @@ jobs:
./hello
spec_test_default:
needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
needs: [build_iwasm, build_llvm_libraries, build_wamrc]
runs-on: ubuntu-20.04
strategy:
matrix:
running_mode: ["classic-interp", "fast-interp", "aot"]
test_option: ["-x -p -s spec -P", "-x -p -s spec -S -P"]
include:
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
# classic-interp and fast-interp don't support simd
exclude:
- running_mode: "classic-interp"
test_option: "-x -p -s spec -S -P"
- running_mode: "fast-interp"
test_option: "-x -p -s spec -S -P"
steps:
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v3
- name: Get LLVM libraries
if: ${{ matrix.light == 'green' }}
if: matrix.running_mode == 'aot'
id: cache_llvm
uses: actions/cache@v3
with:
@ -440,15 +347,13 @@ jobs:
key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
if: matrix.running_mode == 'aot' && steps.cache_llvm.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: install Ninja
if: ${{ matrix.light == 'green' }}
run: sudo apt install -y ninja-build
- name: install SGX SDK and necessary libraries
if: ${{ matrix.light == 'green' }}
run: |
mkdir -p /opt/intel
cd /opt/intel
@ -461,7 +366,6 @@ jobs:
sudo apt install -y libsgx-launch libsgx-urts
- name: run spec tests
if: ${{ matrix.light == 'green' }}
run: |
source /opt/intel/sgxsdk/environment
./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}

View File

@ -6,20 +6,36 @@ name: compilation on windows-latest
on:
# will be triggered on PR events
pull_request:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
- ".github/workflows/compilation_on_windows.yml"
types:
- opened
- synchronize
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# will be triggered on push events
push:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
- ".github/workflows/compilation_on_windows.yml"
branches:
- main
- "dev/**"
paths:
- ".github/**"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
- "product-mini/**"
- "samples/**"
- "!samples/workload/**"
- "tests/wamr-test-suites/**"
- "wamr-compiler/**"
- "wamr-sdk/**"
# allow to be triggered manually
workflow_dispatch:
@ -30,18 +46,7 @@ concurrency:
cancel-in-progress: true
jobs:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
cancel_previous:
runs-on: windows-latest
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
build:
needs: cancel_previous
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

68
.github/workflows/create_tag.yml vendored Normal file
View File

@ -0,0 +1,68 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: create a tag
on:
workflow_call:
outputs:
minor_version:
description: "the new version is a minor version or a major version"
value: ${{ jobs.create_tag.outputs.minor_version}}
new_ver:
description: "the new version"
value: ${{ jobs.create_tag.outputs.new_ver}}
new_tag:
description: "the new tag just created"
value: ${{ jobs.create_tag.outputs.new_tag}}
jobs:
create_tag:
runs-on: ubuntu-latest
outputs:
minor_version: ${{ steps.preparation.outputs.minor_version }}
new_ver: ${{ steps.preparation.outputs.new_ver }}
new_tag: ${{ steps.preparation.outputs.new_tag }}
steps:
- uses: actions/checkout@v3
# Full git history is needed to get a proper list of commits and tags
with:
fetch-depth: 0
- name: prepare
id: preparation
run: |
# show latest 3 versions
git tag --list WAMR-*.*.* --sort=committerdate --format="%(refname:short)" | tail -n 3
# compare latest git tag and semantic version definition
result=$(python3 ./.github/scripts/fetch_and_compare_version.py)
echo "script result is ${result}"
#
# return in a form like "WAMR-X.Y.Z,major_minor_change" or ",patch_change"
new_ver=$(echo "${result}" | awk -F',' '{print $1}')
diff_versioning=$(echo "${result}" | awk -F',' '{print $2}')
echo "next version is ${new_ver}, it ${diff_versioning}"
#
# set output
if [[ ${diff_versioning} == 'major_minor_change' ]];then
echo "minor_version=true" >> "$GITHUB_OUTPUT"
else
echo "minor_version=false" >> "$GITHUB_OUTPUT"
fi
#
#
if [[ -z ${new_ver} ]]; then
echo "::error::please indicate the right semantic version in build-scripts/config_common.cmake"
echo "new_ver=''" >> "$GITHUB_OUTPUT"
echo "new_tag=''" >> "$GITHUB_OUTPUT"
exit 1
else
echo "new_ver=${new_ver}" >> "$GITHUB_OUTPUT"
echo "new_tag=WAMR-${new_ver}" >> "$GITHUB_OUTPUT"
fi
- name: push tag
if: steps.preparation.outputs.new_tag != ''
run: |
git tag ${{ steps.preparation.outputs.new_tag }}
git push origin --force --tags

193
.github/workflows/release_process.yml vendored Normal file
View File

@ -0,0 +1,193 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: the binary release processes
on:
workflow_dispatch:
inputs:
require_confirmation:
description: "If the process requires a confirmation"
type: boolean
required: false
default: false
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
create_tag:
uses: ./.github/workflows/create_tag.yml
create_release:
needs: [create_tag]
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
- name: prepare the release note
run: |
extract_result="$(python3 ./.github/scripts/extract_from_release_notes.py RELEASE_NOTES.md)"
echo "RELEASE_NOTE<<EOF" >> $GITHUB_ENV
echo "${extract_result}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: check output
run: echo 'the release note is "${{ env.RELEASE_NOTE }}"'
- name: create a release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.create_tag.outputs.new_tag }}
release_name: ${{ needs.create_tag.outputs.new_tag }}
prerelease: ${{ inputs.require_confirmation || needs.create_tag.outputs.minor_version }}
draft: false
body: ${{ env.RELEASE_NOTE }}
#
# WAMRC
release_wamrc_on_ubuntu_2004:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamrc.yml
with:
# can't take an env variable here
llvm_cache_key: ubuntu-20.04-build-llvm_libraries_ex
release: true
runner: ubuntu-20.04
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
release_wamrc_on_ubuntu_2204:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamrc.yml
with:
# can't take an env variable here
llvm_cache_key: ubuntu-22.04-build-llvm_libraries_ex
release: true
runner: ubuntu-22.04
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver }}
release_wamrc_on_ubuntu_macos:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamrc.yml
with:
# can't take an env variable here
llvm_cache_key: macos-latest-build-llvm_libraries_ex
release: true
runner: macos-latest
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver }}
#
# IWASM
release_iwasm_on_ubuntu_2004:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_iwasm_release.yml
with:
cwd: product-mini/platforms/linux
runner: ubuntu-20.04
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
release_iwasm_on_ubuntu_2204:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_iwasm_release.yml
with:
cwd: product-mini/platforms/linux
runner: ubuntu-22.04
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
release_iwasm_on_macos:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_iwasm_release.yml
with:
cwd: product-mini/platforms/darwin
runner: macos-latest
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
#
# WAMR_SDK
release_wamr_sdk_on_ubuntu_2004:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamr_sdk.yml
with:
config_file: wamr_config_ubuntu_release.cmake
runner: ubuntu-20.04
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
wasi_sdk_url: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
release_wamr_sdk_on_ubuntu_2204:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamr_sdk.yml
with:
config_file: wamr_config_ubuntu_release.cmake
runner: ubuntu-22.04
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
wasi_sdk_url: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
release_wamr_sdk_on_macos:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamr_sdk.yml
with:
config_file: wamr_config_macos_release.cmake
runner: macos-latest
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
wasi_sdk_url: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
#
# vscode extension cross-platform
release_wamr_ide_vscode_ext:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamr_vscode_ext.yml
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver }}
#
# vscode extension docker images package
release_wamr_ide_docker_images_package:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_docker_images.yml
with:
ver_num: ${{ needs.create_tag.outputs.new_ver }}
#
# WAMR_LLDB
release_wamr_lldb_on_ubuntu_2004:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamr_lldb.yml
with:
runner: ubuntu-20.04
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
release_wamr_lldb_on_ubuntu_2204:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamr_lldb.yml
with:
runner: ubuntu-22.04
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}
release_wamr_lldb_on_macos_universal:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_wamr_lldb.yml
with:
runner: macos-latest
arch: universal
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}

View File

@ -0,0 +1,68 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: reuse binaries of the latest release if no more modification on the_path since last_commit
on:
workflow_call:
inputs:
binary_name_stem:
type: string
required: true
last_commit:
type: string
required: true
the_path:
type: string
required: true
upload_url:
description: upload binary assets to the URL of release
type: string
required: true
outputs:
result:
value: ${{ jobs.build.outputs.result }}
jobs:
reuse:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.try_reuse.outputs.result }}
steps:
- uses: actions/checkout@v3
# Full git history is needed to get a proper list of commits and tags
with:
fetch-depth: 0
- name: try to reuse binaries
id: try_reuse
run: |
echo '::echo::on'
python3 ./.github/scripts/reuse_latest_release_binaries.py \
--binary_name_stem ${{ inputs.binary_name_stem }} \
--last_commit ${{ inputs.last_commit }} \
--the_path ${{ inputs.the_path }} .
ls -lh .
- run: echo ${{ steps.try_reuse.outputs.result }}
- name: upload release tar.gz
if: steps.try_reuse.outputs.result == 'hit'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ inputs.binary_name_stem }}.tar.gz
asset_name: ${{ inputs.binary_name_stem }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
if: steps.try_reuse.outputs.result == 'hit'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ inputs.binary_name_stem }}.zip
asset_name: ${{ inputs.binary_name_stem }}.zip
asset_content_type: application/zip