Skip to content

Commit f225f58

Browse files
committed
Merge branch 'develop' into TASK-7555
2 parents c841e46 + bd7362f commit f225f58

File tree

9 files changed

+44
-58
lines changed

9 files changed

+44
-58
lines changed

.github/workflows/develop.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@ on:
77
- release-*
88

99
jobs:
10-
build:
11-
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
12-
1310
test:
1411
uses: ./.github/workflows/test-analysis.yml
15-
needs: build
1612
secrets: inherit
1713

1814
deploy-maven:
1915
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
2016
needs: test
2117
with:
2218
maven_opts: -U -DskipTests
19+
cache_key: ${{ needs.test.outputs.cache_key }}
2320
secrets: inherit

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@ on:
88
jobs:
99
build:
1010
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
11+
with:
12+
maven_opts: --update-snapshots -DskipTests
13+
upload_artifacts: false
14+
needs_hadoop_preparation: false
15+
dependency_repos: "java-common-libs"
16+
secrets: inherit
1117

1218
deploy-maven:
1319
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
1420
needs: build
1521
secrets: inherit
22+
with:
23+
cache_key: ${{ needs.build.outputs.cache_key }}
1624

1725
release:
1826
uses: opencb/java-common-libs/.github/workflows/release-github-workflow.yml@develop

.github/workflows/scripts/get_same_branch.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/task.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ on:
66
- TASK-*
77

88
jobs:
9-
build:
10-
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
11-
129
test:
1310
uses: ./.github/workflows/test-analysis.yml
14-
needs: build
1511
secrets: inherit

.github/workflows/test-analysis.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
name: Build and test the project
22
on:
33
workflow_call:
4+
outputs:
5+
cache_key:
6+
description: "Cache key used for Maven repository"
7+
value: ${{ jobs.build.outputs.cache_key }}
48
secrets:
59
SONAR_TOKEN:
610
required: true
711

812
jobs:
13+
14+
build:
15+
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
16+
with:
17+
needs_hadoop_preparation: false
18+
upload_artifact: false
19+
dependency_repos: "java-common-libs"
20+
secrets: inherit
21+
922
test:
1023
name: Test and push Sonar analysis
24+
needs: build
1125
runs-on: ${{ vars.UBUNTU_VERSION }}
1226
steps:
1327
- uses: actions/checkout@v4
@@ -19,16 +33,15 @@ jobs:
1933
distribution: 'temurin'
2034
java-version: '11'
2135
cache: 'maven'
36+
- name: Cache local Maven repository
37+
uses: actions/cache/restore@v4
38+
with:
39+
path: ~/.m2/repository
40+
key: ${{ needs.build.outputs.cache_key }}
41+
## Force cache hit to avoid analyzing with incomplete dependencies
42+
fail-on-cache-miss: true
2243
- name: Install Samtools
2344
run: sudo apt-get install samtools
24-
- name: Install dependencies branches
25-
run: |
26-
if [ -f "./.github/workflows/scripts/get_same_branch.sh" ]; then
27-
chmod +x ./.github/workflows/scripts/get_same_branch.sh
28-
./.github/workflows/scripts/get_same_branch.sh ${{ github.ref_name }}
29-
else
30-
echo "./.github/workflows/scripts/get_same_branch.sh does not exist."
31-
fi
3245
- name: Test and Analyze
3346
env:
3447
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any

biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/writer/VariantStatsPopulationFrequencyExporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public boolean write(Variant variant) {
9696
PopulationFrequency populationFrequency = converter.convert(studyId,
9797
variantStats, variant.getReference(), variant.getAlternate());
9898
// Write only frequencies non zero
99-
if (populationFrequency.getAltAlleleFreq() > 0 && !populationFrequency.getAltAlleleFreq().isNaN()) {
99+
if (populationFrequency.getAltAlleleFreq() > 0 && !Float.isNaN(populationFrequency.getAltAlleleFreq())) {
100100
frequencies.add(populationFrequency);
101101
}
102102
}

biodata-tools/src/test/java/org/opencb/biodata/tools/variant/stats/SampleVariantStatsCalculatorTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,18 @@ private void checkStats(List<SampleVariantStats> sampleStats) {
117117
for (SampleVariantStats sampleStat : sampleStats) {
118118
Assert.assertFalse(Float.isNaN(sampleStat.getQualityAvg()));
119119
Assert.assertFalse(Float.isInfinite(sampleStat.getQualityAvg()));
120-
Assert.assertEquals(0, sampleStat.getDepthCount().getNa().intValue());
120+
Assert.assertEquals(0, sampleStat.getDepthCount().getNa());
121121
int dp = Integer.parseInt(sampleStat.getId().substring(1)) * 10;
122122
if (dp < 5) {
123-
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt5().intValue());
123+
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt5());
124124
} else if (dp < 10) {
125-
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt10().intValue());
125+
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt10());
126126
} else if (dp < 15) {
127-
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt15().intValue());
127+
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt15());
128128
} else if (dp < 20) {
129-
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt20().intValue());
129+
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt20());
130130
} else {
131-
Assert.assertNotEquals(0, sampleStat.getDepthCount().getGte20().intValue());
131+
Assert.assertNotEquals(0, sampleStat.getDepthCount().getGte20());
132132
}
133133
}
134134
}

biodata-tools/src/test/java/org/opencb/biodata/tools/variant/stats/VariantSetStatsCalculatorTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ public void testStudyStats() throws Exception {
132132

133133
System.out.println("stats = " + stats);
134134

135-
assertEquals(variants, stats.getVariantCount().intValue());
135+
assertEquals(variants, stats.getVariantCount());
136136
assertEquals(((int) (files * variants * passVariants)), stats.getFilterCount().get("PASS").intValue());
137-
assertEquals(files, stats.getFilesCount().intValue());
138-
assertEquals(files * samplesPerFile, stats.getSampleCount().intValue());
137+
assertEquals(files, stats.getFilesCount());
138+
assertEquals(files * samplesPerFile, stats.getSampleCount());
139139
assertEquals(files * samplesPerFile * variants, stats.getGenotypeCount().values().stream().reduce(Long::sum).orElse(0L).intValue());
140140
}
141141

@@ -154,10 +154,10 @@ public void testFileStats() throws Exception {
154154
}
155155
stDev = Math.sqrt(stDev / quals.length);
156156

157-
assertEquals(variants, stats.getVariantCount().intValue());
157+
assertEquals(variants, stats.getVariantCount());
158158
assertEquals(((int) (variants * passVariants)), stats.getFilterCount().get("PASS").intValue());
159-
assertEquals(1, stats.getFilesCount().intValue());
160-
assertEquals(samplesPerFile, stats.getSampleCount().intValue());
159+
assertEquals(1, stats.getFilesCount());
160+
assertEquals(samplesPerFile, stats.getSampleCount());
161161
assertEquals(samplesPerFile * variants, stats.getGenotypeCount().values().stream().reduce(Long::sum).orElse(0L).intValue());
162162

163163
assertEquals(mean, stats.getQualityAvg(), 0.000001);

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
<jackson.version>2.14.3</jackson.version>
4343
<collections.version>4.4</collections.version>
44-
<avro.version>1.7.7</avro.version>
44+
<avro.version>1.11.4</avro.version>
4545
<protobuf.version>3.11.4</protobuf.version>
4646
<grpc.version>1.28.1</grpc.version>
4747
<htsjdk.version>2.23.0</htsjdk.version>

0 commit comments

Comments
 (0)