diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml new file mode 100644 index 000000000..f365e5728 --- /dev/null +++ b/.github/workflows/integration-test.yaml @@ -0,0 +1,82 @@ +name: Integration Tests + +on: + # if pushed directly to the master + push: + branches: + - master + - release/* + # on a pull request + pull_request: + branches: + - master + - release/* +jobs: + redis-cache: + name: Cache with Redis + runs-on: ubuntu-latest + # Docker Hub image that `container-job` executes in. + # Use -buster which comes with Git 2.20, because action/checkout needs Git 2.18+ to make correct clone (needed by Gradle version plugin) + container: node:12-buster + services: + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Check + uses: eskatos/gradle-command-action@v1 + with: + arguments: check + env: + DSHACKLE_TEST_ENABLED: redis + REDIS_HOST: redis + REDIS_PORT: 6379 + + + fake-upstream: + name: Test with fake upstream + runs-on: ubuntu-latest + # Use -buster which comes with Git 2.20, because action/checkout needs Git 2.18+ to make correct clone (needed by Gradle version plugin) + container: node:12-buster + services: + + fake-upstream: + image: openjdk:11 + volumes: + - ${{ github.workspace }}/testing/simple-upstream:/app + options: >- + --workdir /app + --entrypoint /app/start.sh + + dshackle: + image: openjdk:11 + volumes: + - ${{ github.workspace }}:/app + options: >- + --workdir /app + --entrypoint /app/testing/dshackle/start.sh + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Run trial + uses: eskatos/gradle-command-action@v1 + with: + arguments: test + build-root-directory: ${{ github.workspace }}/testing/trial \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 94e7ab189..6361cc0a4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,11 +5,15 @@ on: push: branches: - master + - release/* # on a pull request pull_request: - + branches: + - master + - release/* jobs: unit-test: + name: Unit Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -27,34 +31,4 @@ jobs: - name: Upload Coverage Report uses: codecov/codecov-action@v1 with: - file: ./build/reports/jacoco/test/jacocoTestReport.xml - - integration-test: - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in. - # Use -buster which comes with Git 2.20, because action/checkout needs Git 2.18+ to make correct clone (needed by Gradle version plugin) - container: node:12-buster - services: - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - - uses: actions/checkout@v2 - - - name: Set up JDK - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Check - uses: eskatos/gradle-command-action@v1 - with: - arguments: check - env: - DSHACKLE_TEST_ENABLED: redis - REDIS_HOST: redis - REDIS_PORT: 6379 \ No newline at end of file + file: ./build/reports/jacoco/test/jacocoTestReport.xml \ No newline at end of file diff --git a/testing/dshackle/start.sh b/testing/dshackle/start.sh new file mode 100755 index 000000000..93b1bd3fe --- /dev/null +++ b/testing/dshackle/start.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +set -e +cd ../.. +export SPRING_APPLICATION_JSON='{"configPath": "testing/dshackle/dshackle.yaml"}' +./gradlew run \ No newline at end of file diff --git a/testing/simple-upstream/start.sh b/testing/simple-upstream/start.sh new file mode 100755 index 000000000..314003601 --- /dev/null +++ b/testing/simple-upstream/start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +set -e +./gradlew run \ No newline at end of file