Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
Conflicts:
  src/test/java/jssc/SerialNativeInterfaceTest.java
  • Loading branch information
hiddenalpha committed Nov 14, 2023
2 parents 2042272 + 0cd6aef commit d4150ed
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 102 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: build

on: [push, pull_request]

env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

jobs:
ubuntu:
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
matrix:
include:
- profile: x86
packages: g++-multilib

- profile: x86_64
packages: g++-

- profile: armhf
packages: g++-arm-linux-gnueabihf

- profile: aarch64
packages: g++-aarch64-linux-gnu

- profile: riscv64
packages: g++-riscv64-linux-gnu

- profile: ppc64
packages: g++-powerpc64le-linux-gnu

- profile: mingw32
packages: g++-mingw-w64-i686

- profile: mingw64
packages: g++-mingw-w64-x86-64

- profile: mingwaarch64
packages: clang
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin

- run: sudo apt-get install socat ${{ matrix.packages }}
- run: mvn -P "${{ matrix.profile }}" --batch-mode

macos:
runs-on: [macos-latest]
strategy:
fail-fast: false
matrix:
include:
- profile: aarch64
- profile: x86_64

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin

- run: brew install socat
- run: mvn -P "${{ matrix.profile }}" --batch-mode

windows:
runs-on: [windows-latest]
strategy:
fail-fast: false
matrix:
include:
- profile: aarch64

- profile: x86_64

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin

- run: mvn -P "${{ matrix.profile }}" --batch-mode
27 changes: 21 additions & 6 deletions .github/workflows/cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

jobs:
create-branch:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "precompiled_branch=$(git branch --show-current)-precompiled-natives" >> $GITHUB_ENV
Expand All @@ -31,7 +31,7 @@ jobs:
base_rev: ${{ env.rev }}

linux-windows:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: create-branch
strategy:
matrix:
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
run: docker pull ${{ matrix.image }}

- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
Expand All @@ -118,7 +118,7 @@ jobs:
${{ matrix.image }} \
bash -c \
'apt-get update && apt-get install --yes maven openjdk-11-jdk-headless && \
mvn -B clean install -P dockcross \
mvn -B clean install -P dockcross,update-resources-precompiled \
-Dos.target.name=${{ matrix.os_target_name }} \
-Dos.target.arch=${{ matrix.os_target_arch }} \
-Dos.target.bitness=${{ matrix.os_target_bitness }} \
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
Expand All @@ -171,7 +171,7 @@ jobs:
export SDKROOT=$XCODE_12_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/${{ matrix.sdk-version }}
export CMAKE_OSX_SYSROOT=$SDKROOT
- name: Build with Maven
run: mvn -B clean install -P ${{ matrix.profile }}
run: mvn -B clean install -P ${{ matrix.profile }},update-resources-precompiled

- name: Push recompiled binaries
run: |
Expand All @@ -181,3 +181,18 @@ jobs:
git add src/main/resources-precompiled/**
git commit --allow-empty -m "Precompiled natives (@${{ needs.create-branch.outputs.base_rev }}) for ${{ matrix.target }}"
while git pull --rebase && ! git push; do sleep 5; done
single-commit:
runs-on: ubuntu-latest
needs: [create-branch, linux-windows, macos]
steps:
- uses: actions/checkout@v3
- name: Squash into one commit
run: |
git config --global user.email "${GITHUB_BOT_EMAIL}"
git config --global user.name "${GITHUB_BOT_NAME}"
git fetch && git checkout -t origin/${{ needs.create-branch.outputs.precompiled_branch }}
git reset --soft ${{ needs.create-branch.outputs.base_rev }}
git add src/main/resources-precompiled/**
git commit -m "Precompiled natives @${{ needs.create-branch.outputs.base_rev }}"
git push -f
12 changes: 6 additions & 6 deletions .github/workflows/release-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
maven-central-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: git config --global user.email "${GITHUB_BOT_EMAIL}"
- run: git config --global user.name "${GITHUB_BOT_NAME}"
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
Expand Down Expand Up @@ -50,13 +50,13 @@ jobs:
runs-on: ubuntu-latest
needs: maven-central-release
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ needs.maven-central-release.outputs.releaseTag }}
- run: git config --global user.email "${GITHUB_BOT_EMAIL}"
- run: git config --global user.name "${GITHUB_BOT_NAME}"
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
Expand All @@ -77,7 +77,7 @@ jobs:
env:
ver: ${{ needs.maven-central-release.outputs.releaseVersion }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
git config --global user.email "${GITHUB_BOT_EMAIL}"
git config --global user.name "${GITHUB_BOT_NAME}"
Expand All @@ -95,7 +95,7 @@ jobs:
env:
ver: ${{ needs.maven-central-release.outputs.releaseVersion }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: ${{github.repository}}.wiki
- run: |
Expand Down
88 changes: 0 additions & 88 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ if(CMAKE_STRIP AND NOT CMAKE_BUILD_TYPE MATCHES "Deb")
add_custom_command(TARGET jssc POST_BUILD COMMAND "${CMAKE_STRIP}" ${STRIP_ARGS} $<TARGET_FILE:jssc>)
endif()

# Copy native library back to source tree
# Copy native library to target/classes for processing by junit, maven
add_custom_command(TARGET jssc POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/natives/ ${CMAKE_CURRENT_SOURCE_DIR}/src/main/resources-precompiled/natives/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/natives/ ${CMAKE_CURRENT_BINARY_DIR}/../classes/natives/
)

# Handle compiler warnings
Expand Down
6 changes: 6 additions & 0 deletions ant/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,10 @@
<arg line="${cmake.build.arg}"/>
</exec>
</target>

<target name="update-resources-precompiled">
<copy todir="${ant.project.basedir}/src/main/resources-precompiled/natives/">
<fileset dir="${cmake.generated.directory}/natives/" includes="**" />
</copy>
</target>
</project>
Loading

0 comments on commit d4150ed

Please sign in to comment.