all: run v fmt -w .
in project root
#88
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code CI | |
on: | |
push: | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
concurrency: | |
group: general-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build-and-run-examples: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
steps: | |
- name: Install V | |
uses: vlang/setup-v@v1 | |
with: | |
check-latest: true | |
- name: Install vab | |
run: | | |
v install vab | |
v ~/.vmodules/vab | |
- name: Symlink vab command | |
run: sudo ln -s ~/.vmodules/vab/vab /usr/local/bin/vab | |
- name: Checkout jni | |
uses: actions/checkout@v2 | |
with: | |
path: jni | |
- name: Link local jni folder in ~/.vmodules/jni | |
run: sudo ln -s $(pwd)/jni ~/.vmodules/jni | |
- name: Test code formatting | |
run: | | |
cd jni | |
v test-fmt | |
- name: Run jni tests | |
run: | | |
cd jni | |
v test . | |
- name: Install and run V jni Desktop examples | |
run: | | |
cd jni | |
JNI_HOME=$(pwd) | |
export JAVA_HOME=$JAVA_HOME_11_X64 | |
# Test basic shell operation | |
cd $JNI_HOME/examples/desktop/v_as_library | |
export LD_LIBRARY_PATH=$(pwd):. | |
v -cc gcc -cg -shared libvlang.v | |
javac io/vlang/V.java | |
java io.vlang.V | |
# Test build_and_run.vsh | |
cd $JNI_HOME/examples/desktop/simple | |
v run ./build_and_run.vsh | |
- name: Build Android examples | |
run: | | |
declare -a jni_android_examples=('keyboard' 'toast') | |
mkdir apks | |
for example in "${jni_android_examples[@]}"; do | |
safe_name=$(echo "$example" | sed 's%/%-%' | sed 's%\.%-%' ) | |
vab --api 29 --build-tools '29.0.0' -v 3 jni/examples/android/$example -o apks/$safe_name.apk | |
done |