Build #1230
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build" | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
build_bf: [false] | |
build_zarr: [false] | |
build_snapshot: [false] | |
python-version: | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
name: Build OMERO from source | |
runs-on: ubuntu-22.04 | |
env: | |
ICE_HOME: /opt/ice-3.6.5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Ice and Ice python binding | |
if: matrix.build_snapshot | |
uses: jburel/action-ice@v3 | |
- name: Set up Gradle 6.8.3 | |
if: matrix.build_snapshot | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 6.8.3 | |
arguments: build -x test | |
build-root-directory: components/tools/OmeroJava # required by the action to have a *.gradle file" | |
- name: Install and run flake8 | |
run: | | |
pip install flake8 'setuptools<69' | |
flake8 . | |
- name: install dependencies | |
run: | | |
sudo apt-get install -y git | |
- name: Build Bio-Formats | |
id: bf | |
if: matrix.build_bf | |
run: | | |
git clone https://github.com/ome/bioformats /tmp/bioformats --depth 1 | |
cd /tmp/bioformats | |
mvn install -DskipTests -q | |
echo "bf_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT | |
echo "ome_common_version=$(mvn help:evaluate -Dexpression=ome-common.version -q -DforceStdout)" >> $GITHUB_OUTPUT | |
- name: Build ZarrReader | |
id: zarr_reader | |
if: matrix.build_zarr | |
run: | | |
git clone https://github.com/ome/ZarrReader /tmp/ZarrReader --depth 1 | |
cd /tmp/ZarrReader | |
mvn install -DskipTests -q | |
echo "zarr_reader_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT | |
- name: Set ZarrReader version | |
if: matrix.build_zarr | |
run: | | |
sed -i 's/versions.OMEZarrReader=.*/versions.OMEZarrReader=${{ steps.zarr_reader.outputs.zarr_reader_version }}/' etc/omero.properties | |
- name: Set Bio-Formats version | |
if: matrix.build_bf | |
run: | | |
DEPENDENCY="<dependency org=\"org.openmicroscopy\" name=\"ome-common\" rev=\"${{ steps.bf.outputs.ome_common_version }}\">\n<artifact name=\"ome-common\" type=\"jar\" ext=\"jar\"\/>\n<\/dependency>" | |
sed -i 's/versions.bioformats=.*/versions.bioformats=${{ steps.bf.outputs.bf_version }}/' etc/omero.properties | |
sed -i "s/<dependencies>/<dependencies>\n $DEPENDENCY/" components/tools/OmeroJava/ivy.xml | |
- name: Build snapshot | |
if: matrix.build_snapshot | |
id: snapshot | |
run: | | |
# to use own repo | |
# git clone -b your_branch https://github.com/your_repo/omero-gateway-java /tmp/omero-gateway-java | |
git clone https://github.com/ome/omero-gateway-java /tmp/omero-gateway-java --depth 1 | |
cd /tmp/omero-gateway-java | |
gradle publishToMavenLocal -x test | |
echo "gateway_version=$(gradle properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- name: Set snapshot version | |
if: matrix.build_snapshot | |
run: | | |
sed -i 's/versions.omero-gateway=.*/versions.omero-gateway=${{ steps.snapshot.outputs.gateway_version }}/' etc/omero.properties | |
- name: Build | |
run: ./build.py | |
- name: Rebuild | |
run: ./build.py clean && ./build.py |