From db549fb3a10488dd6ae9cbce2859b4b8fb4fce7e Mon Sep 17 00:00:00 2001 From: Michael Moen Allport Date: Wed, 9 Aug 2023 15:53:46 +0200 Subject: [PATCH 1/7] Add workflow to automatically run tests --- .github/workflows/tests.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..d10a4a79 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,23 @@ +name: Java CI + +on: [push] + +jobs: + build: + strategy: + matrix: + # run 2 copies of the current job in parallel + # and they will load balance all specs + os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 1.8 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8' + cache: maven + - name: Build, test and package with Maven + run: mvn --batch-mode --update-snapshots package -P nexus \ No newline at end of file From fb05a51371b08e05be02ac67ee6296adea29593e Mon Sep 17 00:00:00 2001 From: Michael Moen Allport Date: Wed, 9 Aug 2023 15:54:40 +0200 Subject: [PATCH 2/7] Make workflow run less frequently --- .github/workflows/tests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d10a4a79..2f33eaf1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,12 @@ name: Java CI -on: [push] +on: + push: + branches: + - master + pull_request: + paths-ignore: + - '**.md' jobs: build: From 766c09390538d5d713e8931234160efdfb90d542 Mon Sep 17 00:00:00 2001 From: Michael Moen Allport Date: Wed, 9 Aug 2023 16:22:40 +0200 Subject: [PATCH 3/7] Add 'nexus' profile to klass-solr --- klass-solr/pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/klass-solr/pom.xml b/klass-solr/pom.xml index d58e34be..1564d8c3 100644 --- a/klass-solr/pom.xml +++ b/klass-solr/pom.xml @@ -123,5 +123,17 @@ + + + nexus + + + ssb-repo + Nexus + https://nexus.ssb.no/repository/maven-public + + + + \ No newline at end of file From 9472ba5554218b01a338cc63dc56cb5b1fe4414f Mon Sep 17 00:00:00 2001 From: Michael Moen Allport Date: Wed, 9 Aug 2023 16:41:53 +0200 Subject: [PATCH 4/7] Downgrade Maven in workflows --- .github/workflows/tests.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2f33eaf1..1dab27da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,5 @@ -name: Java CI +name: Tests + on: push: @@ -25,5 +26,15 @@ jobs: distribution: 'zulu' java-version: '8' cache: maven + + # Need to downgrade Maven in order to allow HTTP (not HTTPS) packages to be downloaded. + # This is necessary as HTTP repositories were blocked in Maven 3.8.1 + # HTTP repositories are used in some outdated dependencies + # This step can be removed once KLASS packages have been updated to more recent versions + - name: Set up Maven + uses: stCarolas/setup-maven@v4.5 + with: + maven-version: 3.8.0 + - name: Build, test and package with Maven run: mvn --batch-mode --update-snapshots package -P nexus \ No newline at end of file From b5e6d102ce5b096cc5fc3b5f168bceafa1e7a44a Mon Sep 17 00:00:00 2001 From: Michael Moen Allport Date: Wed, 9 Aug 2023 16:43:14 +0200 Subject: [PATCH 5/7] Change Maven version --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1dab27da..42aee7cf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Maven uses: stCarolas/setup-maven@v4.5 with: - maven-version: 3.8.0 + maven-version: 3.6.3 - name: Build, test and package with Maven run: mvn --batch-mode --update-snapshots package -P nexus \ No newline at end of file From d908c8be64e586b7f3e2852e89101bc220a57e4e Mon Sep 17 00:00:00 2001 From: Michael Moen Allport Date: Wed, 9 Aug 2023 16:50:39 +0200 Subject: [PATCH 6/7] Remove Windows from test environment. Change name of Action --- .github/workflows/tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 42aee7cf..3973a7bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,5 +1,5 @@ name: Tests - +run-name: "Build, tests and package" on: push: @@ -13,9 +13,7 @@ jobs: build: strategy: matrix: - # run 2 copies of the current job in parallel - # and they will load balance all specs - os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ] + os: [ 'ubuntu-latest', 'macos-latest' ] runs-on: ${{ matrix.os }} steps: @@ -29,7 +27,7 @@ jobs: # Need to downgrade Maven in order to allow HTTP (not HTTPS) packages to be downloaded. # This is necessary as HTTP repositories were blocked in Maven 3.8.1 - # HTTP repositories are used in some outdated dependencies + # HTTP repositories are used in some outdated dependenciesns # This step can be removed once KLASS packages have been updated to more recent versions - name: Set up Maven uses: stCarolas/setup-maven@v4.5 From e63e90f1e554dcb80a7ef93b583be7d8fa81d3a2 Mon Sep 17 00:00:00 2001 From: Michael Moen Allport Date: Wed, 9 Aug 2023 17:00:36 +0200 Subject: [PATCH 7/7] Remove 'nexus' profile from klass-solr --- klass-solr/pom.xml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/klass-solr/pom.xml b/klass-solr/pom.xml index 1564d8c3..d58e34be 100644 --- a/klass-solr/pom.xml +++ b/klass-solr/pom.xml @@ -123,17 +123,5 @@ - - - nexus - - - ssb-repo - Nexus - https://nexus.ssb.no/repository/maven-public - - - - \ No newline at end of file