From 7032559509e377cbf0fdb98fbe906fd0648f4d5a Mon Sep 17 00:00:00 2001 From: Oleksii Moskalenko Date: Wed, 17 Nov 2021 05:37:31 +0200 Subject: [PATCH] Dedicated workflow for java PRs (#2050) Signed-off-by: pyalex --- .github/workflows/java_master_only.yml | 75 +++++++++++++++++++ .../{java_complete.yml => java_pr.yml} | 22 ++---- 2 files changed, 83 insertions(+), 14 deletions(-) rename .github/workflows/{java_complete.yml => java_pr.yml} (89%) diff --git a/.github/workflows/java_master_only.yml b/.github/workflows/java_master_only.yml index 417a99d9aa..3330a356e9 100644 --- a/.github/workflows/java_master_only.yml +++ b/.github/workflows/java_master_only.yml @@ -43,3 +43,78 @@ jobs: docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:develop docker push gcr.io/kf-feast/feast-${{ matrix.component }}:develop fi + + lint-java: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: Lint java + run: make lint-java + + unit-test-java: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: '11' + java-package: jdk + architecture: x64 + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-ut-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-ut-maven- + - name: Test java + run: make test-java-with-coverage + - uses: actions/upload-artifact@v2 + with: + name: java-coverage-report + path: ${{ github.workspace }}/docs/coverage/java/target/site/jacoco-aggregate/ + + integration-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: '11' + java-package: jdk + architecture: x64 + - uses: actions/setup-python@v2 + with: + python-version: '3.7' + architecture: 'x64' + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-it-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-it-maven- + - name: Set up gcloud SDK + uses: google-github-actions/setup-gcloud@v0 + with: + project_id: ${{ secrets.GCP_PROJECT_ID }} + service_account_key: ${{ secrets.GCP_SA_KEY }} + export_default_credentials: true + - name: Use gcloud CLI + run: gcloud info + - name: Set up AWS SDK + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + - name: Use AWS CLI + run: aws sts get-caller-identity + - name: Run integration tests + run: make test-java-integration diff --git a/.github/workflows/java_complete.yml b/.github/workflows/java_pr.yml similarity index 89% rename from .github/workflows/java_complete.yml rename to .github/workflows/java_pr.yml index 716cbc950d..f7b90c729f 100644 --- a/.github/workflows/java_complete.yml +++ b/.github/workflows/java_pr.yml @@ -1,11 +1,15 @@ -name: java_complete +name: java_pr -on: [push, pull_request] +on: + pull_request_target: + types: + - opened + - synchronize + - labeled jobs: lint-java: - container: gcr.io/kf-feast/feast-ci:latest - runs-on: [ubuntu-latest] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: @@ -45,16 +49,6 @@ jobs: || (github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved'))) runs-on: ubuntu-latest needs: unit-test-java - services: - redis: - image: redis - ports: - - 6389:6379 - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 steps: - uses: actions/checkout@v2 with: