-
Notifications
You must be signed in to change notification settings - Fork 102
88 lines (87 loc) · 3.5 KB
/
source_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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