Skip to content

Examples

Examples #247

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-11
llvm_bin_path: /usr/local/opt/llvm@13/bin
- os: ubuntu-20.04
llvm_bin_path: /usr/lib/llvm-13/bin
runs-on: ${{ matrix.os }}
env:
SN_RELEASE: fast
LLVM_VERSION: 13
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
echo "It's a Mac"
else
docker run -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres
docker run -p 6379:6379 -d redis
fi
- name: Cache sbt-vcpkg
uses: actions/cache@v3
with:
path: |
~/Library/Caches/sbt-vcpkg/vcpkg
~/.cache/sbt-vcpkg/vcpkg
key: ${{ runner.os }}-sbt-vcpkg
- name: Run examples
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"}"
cd examples
sbt 'runBatchedExamples ${{matrix.segment}} 3'