diff --git a/.github/settings.xml b/.github/settings.xml new file mode 100644 index 0000000000..59d889141e --- /dev/null +++ b/.github/settings.xml @@ -0,0 +1,13 @@ + + + + + gha + + true + + + + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d118728506..ba849b4647 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,23 +14,12 @@ jobs: build: strategy: matrix: - jdk_version: ['17'] + jdk_version: [ '17' ] fail-fast: false - runs-on: self-hosted + runs-on: ubuntu-latest steps: - - name: Clear /tmp - run: | - docker run --rm -v /tmp:/data alpine find /data -ctime +2 -exec rm -rf '{}' \; 2>&1 > /dev/null || true - - - name: Clear old Docker resources - run: | - docker rm -f $(docker ps -aq) || true - docker volume rm $(docker volume ps -q) || true - docker system prune -af || true - docker image prune -af || true - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 with: @@ -42,21 +31,17 @@ jobs: username: ${{ secrets.OSS_DOCKERHUB_USERNAME }} password: ${{ secrets.OSS_DOCKERHUB_PASSWORD }} - - uses: actions/checkout@v3 - - name: Set up JDK uses: actions/setup-java@v3 with: java-version: '${{ matrix.jdk_version }}' distribution: 'temurin' - - name: Remove old Concord artifacts - run: | - rm -rf ~/.m2/repository/com/walmartlabs/concord - rm -rf ~/actions-runner/.m2/repository/com/walmartlabs/concord + - name: Checkout + uses: actions/checkout@v3 - name: Build and test with Maven - run: ./mvnw -B clean install -Pdocker -Pit -Pjdk${{ matrix.jdk_version }} - + run: ./mvnw -s .github/settings.xml -B clean install -Pgha -Pdocker -Pit -Pjdk${{ matrix.jdk_version }} + - name: Build with debian docker images - run: ./mvnw -C -B -f docker-images install -DskipTests -Pdocker -Pdebian -Pjdk${{ matrix.jdk_version }} + run: ./mvnw -s .github/settings.xml -C -B -f docker-images install -DskipTests -Pgha -Pdocker -Pdebian -Pjdk${{ matrix.jdk_version }} diff --git a/it/server/pom.xml b/it/server/pom.xml index 70c293ea02..ac7d42d62f 100644 --- a/it/server/pom.xml +++ b/it/server/pom.xml @@ -29,6 +29,7 @@ ldap-node:389 custom 8001 + false ${settings.localRepository} net-server-it osixia/openldap @@ -268,6 +269,7 @@ ldap://localhost:${it.ldap.port} ${project.version} ${it.server.port} + ${it.skipDocker} ${tmp.dir} diff --git a/it/server/src/test/java/com/walmartlabs/concord/it/server/AbstractServerIT.java b/it/server/src/test/java/com/walmartlabs/concord/it/server/AbstractServerIT.java index c13c02546d..9d715ed5c0 100644 --- a/it/server/src/test/java/com/walmartlabs/concord/it/server/AbstractServerIT.java +++ b/it/server/src/test/java/com/walmartlabs/concord/it/server/AbstractServerIT.java @@ -214,4 +214,8 @@ protected static String env(String k, String def) { } return v; } + + public static boolean shouldSkipDockerTests() { + return Boolean.parseBoolean(System.getenv("IT_SKIP_DOCKER_TESTS")); + } } diff --git a/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerAnsibleIT.java b/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerAnsibleIT.java index 2a2242a04c..a448bcab6a 100644 --- a/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerAnsibleIT.java +++ b/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerAnsibleIT.java @@ -24,6 +24,7 @@ import com.walmartlabs.concord.client.ProcessEntry; import com.walmartlabs.concord.client.StartProcessResponse; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIf; import java.io.File; import java.util.HashMap; @@ -35,6 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +@DisabledIf(value = "shouldSkipDockerTests", disabledReason = "Requires dockerd listening on a tcp socket. Not available in a typical CI environment") public class DockerAnsibleIT extends AbstractServerIT { @Test diff --git a/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerIT.java b/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerIT.java index 04b298115f..ccaec122c2 100644 --- a/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerIT.java +++ b/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerIT.java @@ -24,6 +24,7 @@ import com.walmartlabs.concord.client.ProcessEntry; import com.walmartlabs.concord.client.StartProcessResponse; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIf; import java.util.HashMap; import java.util.Map; @@ -32,6 +33,7 @@ import static com.walmartlabs.concord.it.common.ServerClient.*; import static org.junit.jupiter.api.Assertions.assertNotNull; +@DisabledIf(value = "shouldSkipDockerTests", disabledReason = "Requires dockerd listening on a tcp socket. Not available in a typical CI environment") public class DockerIT extends AbstractServerIT { @Test