Skip to content

Commit

Permalink
start doing tests for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Nov 22, 2024
1 parent 542d155 commit 9bdfbdc
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Integration Tests
on:
push:
branches: [ master ]
paths-ignore:
- .github/workflows/macos_test.yml
pull_request:
branches: [ master ]

Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/macos_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Macos Tests

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

env:
MODELS: "ambitious-sloth, placid-llama, chatty-frog, hiding-tiger, laid-back-lobster"
JSON_FPATH: outputs.json
MACRO_FPATH: macro.ijm

jobs:
integration-tests:
strategy:
fail-fast: false
matrix:
include:
- name: macos-arm64
os: macos-14
url_file_name: fiji-macosx.zip
fiji_executable: Contents/MacOS/ImageJ-macosx
- name: macos-x86_64
os: macos-13
url_file_name: fiji-macosx.zip
fiji_executable: Contents/MacOS/ImageJ-macosx
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'

- name: Set up Fiji
shell: bash
run: |
mkdir -p fiji
curl -L -o fiji.zip https://downloads.imagej.net/fiji/latest/${{ matrix.url_file_name }}
unzip fiji.zip -d fiji
- name: Build Plugin
run: mvn clean package

- name: Get plugin name and version
shell: bash
run: |
MVN_VERSION=$(mvn -q \
-Dexec.executable=echo \
-Dexec.args='${project.version}' \
--non-recursive \
exec:exec)
MVN_NAME=$(mvn -q \
-Dexec.executable=echo \
-Dexec.args='${project.name}' \
--non-recursive \
exec:exec)
echo "version=${MVN_VERSION}" >> $GITHUB_OUTPUT
echo "name=${MVN_NAME}" >> $GITHUB_OUTPUT
id: mvn_info

- name: Copy Plugin to Fiji
shell: bash
run: cp target/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar fiji/Fiji.app/plugins/

- name: Download dependencies
shell: bash
run: |
curl -L --output-dir fiji/Fiji.app/jars/ -O "https://maven.scijava.org/content/groups/public/io/bioimage/dl-modelrunner/0.5.10-SNAPSHOT/dl-modelrunner-0.5.10-20241113.165548-69.jar"
curl -L --output-dir fiji/Fiji.app/jars/ -O "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.13.0/jna-platform-5.13.0.jar"
- name: Set up engine using Jython script and Fiji headless
shell: bash
run: |
fiji/Fiji.app/${{ matrix.fiji_executable }} --headless --console scripts/download_engines.py -engines_path fiji/Fiji.app/engines
- name: Set up the wanted models to test and create macro
shell: bash
run: |
fiji/Fiji.app/${{ matrix.fiji_executable }} --headless --console .github/create_macro.py \
-model_nicknames "${{ env.MODELS }}" \
-models_dir fiji/Fiji.app/models \
-macro_path ${{ env.MACRO_FPATH }} \
-json_fpath ${{ env.JSON_FPATH }}
- name: Run macros
shell: bash
run: |
fiji/Fiji.app/${{ matrix.fiji_executable }} --headless --console --debug -macro ${{ env.MACRO_FPATH }}
- name: Check that the expected result has been produced
shell: bash
run: |
fiji/Fiji.app/${{ matrix.fiji_executable }} --headless --console .github/check_outputs.py -json_fpath ${{ env.JSON_FPATH }}
Binary file added test_samples/test_image.tif
Binary file not shown.

0 comments on commit 9bdfbdc

Please sign in to comment.