diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d131e3a07..c563ce47e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,11 @@ name: ci on: [ push ] +env: + JAVA_VERSION: 21 + jobs: - build: + build-linux: runs-on: ubuntu-latest strategy: matrix: @@ -11,9 +14,6 @@ jobs: steps: # Checkout - - name: Configure git to checkout as-is - run: git config --global core.autocrlf false - - name: Checkout uses: actions/checkout@v4 with: @@ -29,7 +29,7 @@ jobs: - name: Set up GraalVM uses: graalvm/setup-graalvm@v1 with: - java-version: "21" + java-version: ${{ env.JAVA_VERSION }} distribution: "graalvm" cache: "maven" @@ -120,9 +120,46 @@ jobs: images: athou/commafeed:master-native,athou/commafeed:master-jvm push: true + build-windows: + runs-on: windows-latest + strategy: + matrix: + database: [ "h2", "postgresql", "mysql", "mariadb" ] + + steps: + # Checkout + - name: Configure git to checkout as-is + run: git config --global core.autocrlf false + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Setup + - name: Set up GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: "graalvm" + cache: "maven" + + # Build & Test + - name: Build with Maven + run: mvn --batch-mode --no-transfer-progress install -Pnative -P${{ matrix.database }} -DskipTests=${{ matrix.database != 'h2' }} + + # Upload artifacts + - name: Upload native executable + uses: actions/upload-artifact@v4 + with: + name: commafeed-${{ matrix.database }}-${{ runner.os }}-${{ runner.arch }} + path: commafeed-server/target/commafeed-*-runner.exe + release: runs-on: ubuntu-latest - needs: build + needs: + - build-linux + - build-windows if: github.ref_type == 'tag' steps: diff --git a/commafeed-server/src/test/java/com/commafeed/backend/HttpGetterTest.java b/commafeed-server/src/test/java/com/commafeed/backend/HttpGetterTest.java index e0289599b..a10cb2a73 100644 --- a/commafeed-server/src/test/java/com/commafeed/backend/HttpGetterTest.java +++ b/commafeed-server/src/test/java/com/commafeed/backend/HttpGetterTest.java @@ -85,7 +85,7 @@ void validFeed() throws Exception { Assertions.assertEquals(MediaType.APPLICATION_ATOM_XML.toString(), result.getContentType()); Assertions.assertEquals("123456", result.getLastModifiedSince()); Assertions.assertEquals("78910", result.getETag()); - Assertions.assertTrue(result.getDuration() > 0); + Assertions.assertTrue(result.getDuration() >= 0); Assertions.assertEquals(this.feedUrl, result.getUrlAfterRedirect()); }