Skip to content

Examples

Examples #456

Workflow file for this run

name: Examples
on:
schedule:
- cron: "0 2 * * 1,3,5,0"
workflow_dispatch:
inputs:
bindgenVersion:
description: 'Version of bindgen to run (if empty, master will be republished)'
required: false
default: ''
type: string
env:
JAVA_OPTS: "-Xmx4G"
JVM_OPTS: "-Xmx4G"
SBT_OPTS: "-Xmx4G"
jobs:
unix_build:
name: Examples on ${{matrix.os}} ${{matrix.segment}} out of 3
strategy:
fail-fast: false
matrix:
segment: [1, 2, 3]
include:
- os: macos-14
llvm_bin_path: /opt/homebrew/opt/llvm@17/bin
- os: ubuntu-20.04
llvm_bin_path: /usr/lib/llvm-17/bin
runs-on: ${{ matrix.os }}
env:
LLVM_VERSION: 17
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'sbt'
- name: Setup Unix-like
run: ./build/setup_unix.sh
- name: Build
run: sbt devPublish versionDump
if: inputs.bindgenVersion == ''
env:
LLVM_BIN: ${{ matrix.llvm_bin_path }}
- name: Setup for examples
run: |
git clone https://github.com/keynmol/sn-bindgen-examples examples
cd examples
./manual_setup.sh
PLATFORM="$(uname)"
if [ $PLATFORM == "Darwin" ]; then
python3 -m pip install packaging
else
docker run -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres
docker run -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql-password -e MYSQL_DATABASE=mysql_db -p 3306:3306 -d mysql
docker run -p 6379:6379 -d redis
fi
./manual_setup.sh
- name: Cache sbt-vcpkg
uses: actions/cache@v3
with:
path: |
~/Library/Caches/sbt-vcpkg/vcpkg
~/.cache/sbt-vcpkg/vcpkg
key: ${{ runner.os }}-${{ matrix.segment }}-sbt-vcpkg
- name: Run examples (SN 0.5)
env:
LLVM_BIN: ${{ matrix.llvm_bin_path }}
TRIGGER_VERSION: ${{inputs.bindgenVersion}}
run: |
DUMPED_VERSION=$(cat version || echo "")
export SN_BINDGEN_VERSION="${TRIGGER_VERSION:-"$DUMPED_VERSION"}"
export SCALA_NATIVE_VERSION=0.5.0-RC2
cd examples
sbt 'clean; bindgenGenerateAll; runBatchedExamples ${{matrix.segment}} 3'