diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml new file mode 100644 index 0000000000..43c63fb6e2 --- /dev/null +++ b/.github/workflows/build-macos.yml @@ -0,0 +1,54 @@ +# +# Copyright (c) 2019 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at: +# +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +name: 'Build :: MacOS' + +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + +jobs: + build-macos: + name: Eclipse JKube Build on MacOS + runs-on: macos-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@398bb08048482c421b1da00a58a1b472a306eb85 + with: + disable-sudo: true + egress-policy: block + allowed-endpoints: > + downloads.gradle.org:443 + github.com:443 + repo.gradle.org:443 + repo.maven.apache.org:443 + repo1.maven.org:443 + repository.jboss.org:443 + services.gradle.org:443 + objects.githubusercontent.com:443 + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Setup Java 17 + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + with: + java-version: '17' + distribution: 'temurin' + - name: Build JKube + run: | + ./mvnw -B clean install diff --git a/gradle-plugin/it/src/it/git-annotations/expected/kubernetes.yml b/gradle-plugin/it/src/it/git-annotations/expected/kubernetes.yml index f04d1f41c9..38fc248fc2 100644 --- a/gradle-plugin/it/src/it/git-annotations/expected/kubernetes.yml +++ b/gradle-plugin/it/src/it/git-annotations/expected/kubernetes.yml @@ -6,7 +6,7 @@ items: kind: Deployment metadata: annotations: - jkube.eclipse.org/git-url: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)')@" + jkube.eclipse.org/git-url: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)?')@" jkube.eclipse.org/git-commit: "@matches('\\b[0-9a-f]{5,40}\\b')@" jkube.eclipse.org/git-branch: "@assertThat(not(isEmptyString())@" labels: @@ -26,7 +26,7 @@ items: template: metadata: annotations: - jkube.eclipse.org/git-url: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)')@" + jkube.eclipse.org/git-url: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)?')@" jkube.eclipse.org/git-commit: "@matches('\\b[0-9a-f]{5,40}\\b')@" jkube.eclipse.org/git-branch: "@assertThat(not(isEmptyString())@" labels: diff --git a/gradle-plugin/it/src/it/git-annotations/expected/openshift.yml b/gradle-plugin/it/src/it/git-annotations/expected/openshift.yml index 2fe2f5049e..d1b47e6ae4 100644 --- a/gradle-plugin/it/src/it/git-annotations/expected/openshift.yml +++ b/gradle-plugin/it/src/it/git-annotations/expected/openshift.yml @@ -7,8 +7,8 @@ items: metadata: annotations: app.openshift.io/vcs-ref: "@assertThat(not(isEmptyString())@" - jkube.eclipse.org/git-url: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)')@" - app.openshift.io/vcs-uri: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)')@" + jkube.eclipse.org/git-url: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)?')@" + app.openshift.io/vcs-uri: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)?')@" jkube.eclipse.org/git-commit: "@matches('\\b[0-9a-f]{5,40}\\b')@" jkube.eclipse.org/git-branch: "@assertThat(not(isEmptyString())@" labels: @@ -32,8 +32,8 @@ items: metadata: annotations: app.openshift.io/vcs-ref: "@assertThat(not(isEmptyString())@" - jkube.eclipse.org/git-url: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)')@" - app.openshift.io/vcs-uri: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)')@" + jkube.eclipse.org/git-url: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)?')@" + app.openshift.io/vcs-uri: "@matches('(https://|git@)?github.com(:|/)+(.*?)(\\.git)?')@" jkube.eclipse.org/git-commit: "@matches('\\b[0-9a-f]{5,40}\\b')@" jkube.eclipse.org/git-branch: "@assertThat(not(isEmptyString())@" labels: diff --git a/jkube-kit/build/service/docker/src/test/java/org/eclipse/jkube/kit/build/service/docker/WatchServiceTest.java b/jkube-kit/build/service/docker/src/test/java/org/eclipse/jkube/kit/build/service/docker/WatchServiceTest.java index 6ad20ad6f8..46aee204b6 100644 --- a/jkube-kit/build/service/docker/src/test/java/org/eclipse/jkube/kit/build/service/docker/WatchServiceTest.java +++ b/jkube-kit/build/service/docker/src/test/java/org/eclipse/jkube/kit/build/service/docker/WatchServiceTest.java @@ -89,7 +89,7 @@ void setUp(@TempDir Path tempDir) throws IOException { .postExec("ls -lt /deployments") .build()) .build(); - Path path = Files.createDirectory(tempDir.resolve("target")); + Files.createDirectory(tempDir.resolve("target")); watchContext = WatchContext.builder() .buildContext(JKubeConfiguration.builder() .project(JavaProject.builder() @@ -101,8 +101,9 @@ void setUp(@TempDir Path tempDir) throws IOException { } @AfterEach - void tearDown() { - executorService.shutdown(); + void tearDown() throws Exception { + executorService.shutdownNow(); + executorService.awaitTermination(1, TimeUnit.SECONDS); } @Nested