Skip to content

Commit

Permalink
Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
szeiger committed Nov 21, 2024
1 parent d122ad4 commit 71c3bf2
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: PerfIO CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

permissions:
contents: read

defaults:
run:
shell: bash

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: [ '21', '23' ]
runs-on: ${{matrix.os}}
name: Test
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'sbt'
- name: Set up sbt
uses: sbt/setup-sbt@v1
- name: Set up protobuf
run: |
env
mkdir ~/protobuf
(cd ~/protobuf && curl -Lo pb.zip https://github.com/protocolbuffers/protobuf/releases/download/v29.0-rc3/protoc-29.0-rc-3-linux-x86_64.zip && unzip pb.zip)
- name: Run tests
run: sbt test bootstrapProto proto/test
1 change: 1 addition & 0 deletions .jvmopts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--add-modules jdk.incubator.vector
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED
--enable-preview
13 changes: 9 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Global / version := "0.1-SNAPSHOT"

//cancelable in Global := false

val release = "22"
val javaVersion = sys.props("java.specification.version").toInt
val release = if(javaVersion >= 22) 22 else javaVersion

val runtimeOpts = Seq(
"--add-modules", "jdk.incubator.vector",
Expand All @@ -18,12 +19,16 @@ val runtimeOpts = Seq(
)
val compileOpts = Seq(
"--add-modules", "jdk.incubator.vector",
"--release", release,
)
) ++ (if(release >= 22) Seq(
"--release", release.toString,
) else Seq(
"--release", javaVersion.toString,
"--enable-preview",
))

javaOptions in Global ++= runtimeOpts
javacOptions in Global ++= compileOpts
scalacOptions in Global ++= Seq("-java-output-version", release)
scalacOptions in Global ++= Seq("-java-output-version", release.toString)

// javaOptions in Global += "-Djmh.blackhole.autoDetect=false"

Expand Down

0 comments on commit 71c3bf2

Please sign in to comment.