-
Notifications
You must be signed in to change notification settings - Fork 8
94 lines (77 loc) · 2.48 KB
/
examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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'