diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index 92a9f8980..000000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,35 +0,0 @@ -steps: - - label: ":java: [Edge] Unit test with in-memory test service" - agents: - queue: "default" - docker: "*" - command: "./gradlew --no-daemon test -x checkLicenseMain -x checkLicenses -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest" - timeout_in_minutes: 20 - plugins: - - docker-compose#v3.8.0: - run: unit-test-test-service-edge - config: docker/buildkite/docker-compose.yaml - - - label: ":docker: JDK8 Unit test with docker service" - agents: - queue: "default" - docker: "*" - command: "./gradlew --no-daemon test -x checkLicenseMain -x checkLicenses -x spotlessCheck -x spotlessApply -x spotlessJava" - timeout_in_minutes: 20 - plugins: - - docker-compose#v3.8.0: - run: unit-test-docker-jdk8 - config: docker/buildkite/docker-compose.yaml - - - label: ":copyright: Copyright and code format" - agents: - queue: "default" - docker: "*" - command: "./gradlew --no-daemon checkLicenseMain checkLicenses spotlessCheck" - timeout_in_minutes: 20 - plugins: - - docker-compose#v3.8.0: - run: jdk11 - config: docker/buildkite/docker-compose.yaml - - - wait diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..c79b02522 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,86 @@ +name: Continuous Integration +on: + pull_request: + push: + branches: + - master + +jobs: + unit_test_edge: + name: Unit test with in-memory test service [Edge] + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: "19" + distribution: "temurin" + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Run unit tests + run: ./gradlew --no-daemon test -x checkLicenseMain -x checkLicenses -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest + + unit_test_jdk8: + name: Unit test with docker service [JDK8] + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: "11" + distribution: "temurin" + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + + + - name: Start containerized server and dependencies + run: | + docker compose \ + -f ./docker/github/docker-compose.yaml \ + up -d temporal + + - name: Run unit tests + run: ./gradlew --no-daemon test -x checkLicenseMain -x checkLicenses -x spotlessCheck -x spotlessApply -x spotlessJava + + copyright: + name: Copyright and code format + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: "11" + distribution: "temurin" + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Run copyright and code format checks + run: ./gradlew --no-daemon checkLicenseMain checkLicenses spotlessCheck diff --git a/docker/buildkite/Dockerfile-JDK11 b/docker/buildkite/Dockerfile-JDK11 deleted file mode 100644 index 90318e255..000000000 --- a/docker/buildkite/Dockerfile-JDK11 +++ /dev/null @@ -1,7 +0,0 @@ -FROM eclipse-temurin:11-focal - -# Git is needed in order to update the dls submodule -RUN apt-get update && apt-get install -y protobuf-compiler git - -RUN mkdir /temporal-java-client -WORKDIR /temporal-java-client diff --git a/docker/buildkite/Dockerfile-JDK19 b/docker/buildkite/Dockerfile-JDK19 deleted file mode 100644 index 3a46f486d..000000000 --- a/docker/buildkite/Dockerfile-JDK19 +++ /dev/null @@ -1,7 +0,0 @@ -FROM eclipse-temurin:19-jdk-focal - -# Git is needed in order to update the dls submodule -RUN apt-get update && apt-get install -y protobuf-compiler git - -RUN mkdir /temporal-java-client -WORKDIR /temporal-java-client diff --git a/docker/buildkite/Dockerfile-JDK8 b/docker/buildkite/Dockerfile-JDK8 deleted file mode 100644 index 90318e255..000000000 --- a/docker/buildkite/Dockerfile-JDK8 +++ /dev/null @@ -1,7 +0,0 @@ -FROM eclipse-temurin:11-focal - -# Git is needed in order to update the dls submodule -RUN apt-get update && apt-get install -y protobuf-compiler git - -RUN mkdir /temporal-java-client -WORKDIR /temporal-java-client diff --git a/docker/buildkite/README.md b/docker/buildkite/README.md deleted file mode 100644 index 6b87497fa..000000000 --- a/docker/buildkite/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Using BuildKite - -BuildKite simply runs Docker containers. So it is easy to perform the -same build locally that BuildKite will do. To handle this, there are -two different docker-compose files: one for BuildKite and one for local. -The Dockerfile is the same for both. - -## Testing the build locally -To try out the build locally, start from the root folder of this repo -(temporal-java-client) and run the following commands. - -Build the container for - -unit tests: -```bash -docker-compose -f docker/buildkite/docker-compose-local.yml build unit-test-test-service -``` - -unit tests with docker sticky on: -```bash -docker-compose -f docker/buildkite/docker-compose-local.yml build unit-test-docker-sticky-on -``` - -unit tests with docker sticky off: -```bash -docker-compose -f docker/buildkite/docker-compose-local.yml build unit-test-docker-sticky-off -``` - -Run the integration tests: - -unit tests: -```bash -docker-compose -f docker/buildkite/docker-compose-local.yml run unit-test-test-service -``` - -unit tests with docker sticky on: -```bash -docker-compose -f docker/buildkite/docker-compose-local.yml run unit-test-docker-sticky-on -``` - -unit tests with docker sticky off: -```bash -docker-compose -f docker/buildkite/docker-compose-local.yml run unit-test-docker-sticky-off -``` - -Note that BuildKite will run basically the same commands. - -## Testing the build in BuildKite -Creating a PR against the master branch will trigger the BuildKite -build. Members of the Temporal team can view the build pipeline here: -https://buildkite.com/temporal/temporal-java-client - -Eventually this pipeline should be made public. It will need to ignore -third party PRs for safety reasons. diff --git a/docker/buildkite/docker-compose.yaml b/docker/github/docker-compose.yaml similarity index 60% rename from docker/buildkite/docker-compose.yaml rename to docker/github/docker-compose.yaml index 453b65542..650007bf9 100644 --- a/docker/buildkite/docker-compose.yaml +++ b/docker/github/docker-compose.yaml @@ -44,36 +44,3 @@ services: - elasticsearch volumes: - ./dynamicconfig:/etc/temporal/config/dynamicconfig - - - unit-test-docker-jdk8: - build: - context: ../../ - dockerfile: ./docker/buildkite/Dockerfile-JDK8 - environment: - - "USER=unittest" - - "TEMPORAL_SERVICE_ADDRESS=temporal:7233" - - "USE_DOCKER_SERVICE=true" - depends_on: - - temporal - volumes: - - "../../:/temporal-java-client" - - unit-test-test-service-edge: - build: - context: ../../ - dockerfile: ./docker/buildkite/Dockerfile-JDK19 - environment: - - "USER=unittest" - - "USE_DOCKER_SERVICE=false" - volumes: - - "../../:/temporal-java-client" - - jdk11: - build: - context: ../../ - dockerfile: ./docker/buildkite/Dockerfile-JDK11 - environment: - - "USER=unittest" - volumes: - - "../../:/temporal-java-client" \ No newline at end of file diff --git a/docker/buildkite/dynamicconfig/development.yaml b/docker/github/dynamicconfig/development.yaml similarity index 100% rename from docker/buildkite/dynamicconfig/development.yaml rename to docker/github/dynamicconfig/development.yaml