Build #602
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: "Source Build" | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
build_bf: [false] | |
build_zarr: [false, true] | |
build_snapshot: [false] | |
name: Build OMERO from source | |
runs-on: ubuntu-20.04 | |
env: | |
ICE_HOME: /opt/ice-3.6.5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Ice and Ice python binding | |
if: matrix.build_snapshot | |
uses: ome/action-ice@v2.1 | |
- name: Set up JDK 11 | |
if: matrix.build_snapshot | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: 'zulu' | |
- 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 | |
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 |