From f3c0ccd3c86494388447f52bd4ccd896ece55e39 Mon Sep 17 00:00:00 2001 From: Luke Bemish Date: Mon, 15 Jul 2024 00:55:18 -0500 Subject: [PATCH] More assertions --- .github/workflows/build_pr.yml | 2 +- .github/workflows/snapshot.yml | 2 +- build.gradle | 6 +++--- .../opensesame/natives/NativeImplementations.java | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_pr.yml b/.github/workflows/build_pr.yml index 19397d6..54e70a3 100644 --- a/.github/workflows/build_pr.yml +++ b/.github/workflows/build_pr.yml @@ -89,7 +89,7 @@ }, { "name": "Run with Docker", - "run": "docker run --workdir \"${GITHUB_WORKSPACE}\" -v \"${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:z\" --rm --platform linux/${{ matrix.docker_arch }} -t ${{ matrix.docker }} /bin/bash -c \"mkdir ../working; cp -r ./ ../working/; cd ../working; for i in {1..1} ; do (java @args-${{ matrix.os }}.txt) ; done ; return=$?; cp -r ./ ${GITHUB_WORKSPACE}/; cd ${GITHUB_WORKSPACE}; exit $return\"", + "run": "docker run --workdir \"${GITHUB_WORKSPACE}\" -v \"${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:z\" --rm --platform linux/${{ matrix.docker_arch }} -t ${{ matrix.docker }} /bin/bash -c 'mkdir ../working; cp -r ./ ../working/; cd ../working; java @args-${{ matrix.os }}.txt; return=$?; cp -r ./ ${GITHUB_WORKSPACE}/; cd ${GITHUB_WORKSPACE}; exit $return'", "if": "${{ matrix.docker }}" }, { diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 5f0c8e9..8753202 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -89,7 +89,7 @@ }, { "name": "Run with Docker", - "run": "docker run --workdir \"${GITHUB_WORKSPACE}\" -v \"${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:z\" --rm --platform linux/${{ matrix.docker_arch }} -t ${{ matrix.docker }} /bin/bash -c \"mkdir ../working; cp -r ./ ../working/; cd ../working; for i in {1..1} ; do (java @args-${{ matrix.os }}.txt) ; done ; return=$?; cp -r ./ ${GITHUB_WORKSPACE}/; cd ${GITHUB_WORKSPACE}; exit $return\"", + "run": "docker run --workdir \"${GITHUB_WORKSPACE}\" -v \"${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:z\" --rm --platform linux/${{ matrix.docker_arch }} -t ${{ matrix.docker }} /bin/bash -c 'mkdir ../working; cp -r ./ ../working/; cd ../working; java @args-${{ matrix.os }}.txt; return=$?; cp -r ./ ${GITHUB_WORKSPACE}/; cd ${GITHUB_WORKSPACE}; exit $return'", "if": "${{ matrix.docker }}" }, { diff --git a/build.gradle b/build.gradle index a3f6dd1..6488471 100644 --- a/build.gradle +++ b/build.gradle @@ -118,10 +118,10 @@ managedVersioning { step { name.set 'Run with Docker' parameters.put('if', '${{ matrix.docker }}') - run.set 'docker run --workdir "${GITHUB_WORKSPACE}" -v "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:z" --rm --platform linux/${{ matrix.docker_arch }} -t ${{ matrix.docker }} /bin/bash -c "' + + run.set 'docker run --workdir "${GITHUB_WORKSPACE}" -v "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:z" --rm --platform linux/${{ matrix.docker_arch }} -t ${{ matrix.docker }} /bin/bash -c \'' + 'mkdir ../working; cp -r ./ ../working/; cd ../working; ' + - 'for i in {1..1} ; do (java @args-${{ matrix.os }}.txt) ; done ; return=$?; ' + - 'cp -r ./ ${GITHUB_WORKSPACE}/; cd ${GITHUB_WORKSPACE}; exit $return"' + 'java @args-${{ matrix.os }}.txt; return=$?; ' + + 'cp -r ./ ${GITHUB_WORKSPACE}/; cd ${GITHUB_WORKSPACE}; exit $return\'' } step { name.set 'Run' diff --git a/natives/src/main/java/dev/lukebemish/opensesame/natives/NativeImplementations.java b/natives/src/main/java/dev/lukebemish/opensesame/natives/NativeImplementations.java index 733e68b..eb29d6e 100644 --- a/natives/src/main/java/dev/lukebemish/opensesame/natives/NativeImplementations.java +++ b/natives/src/main/java/dev/lukebemish/opensesame/natives/NativeImplementations.java @@ -83,8 +83,9 @@ static void setup() throws IOException { throw new IOException("Could not find native library in opensesame jar, at path "+nativePath); } try (var lib = resource.openStream()) { - Files.copy(lib, path); + Files.copy(lib, path.toAbsolutePath()); } + assert Files.exists(path); System.load(path.toAbsolutePath().toString()); SETUP = true; }