Skip to content

Commit 7032559

Browse files
authored
Dedicated workflow for java PRs (#2050)
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
1 parent afada38 commit 7032559

File tree

2 files changed

+83
-14
lines changed

2 files changed

+83
-14
lines changed

.github/workflows/java_master_only.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,78 @@ jobs:
4343
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:develop
4444
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:develop
4545
fi
46+
47+
lint-java:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v2
51+
with:
52+
submodules: 'true'
53+
- name: Lint java
54+
run: make lint-java
55+
56+
unit-test-java:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v2
60+
with:
61+
submodules: 'true'
62+
- name: Set up JDK 11
63+
uses: actions/setup-java@v1
64+
with:
65+
java-version: '11'
66+
java-package: jdk
67+
architecture: x64
68+
- uses: actions/cache@v2
69+
with:
70+
path: ~/.m2/repository
71+
key: ${{ runner.os }}-ut-maven-${{ hashFiles('**/pom.xml') }}
72+
restore-keys: |
73+
${{ runner.os }}-ut-maven-
74+
- name: Test java
75+
run: make test-java-with-coverage
76+
- uses: actions/upload-artifact@v2
77+
with:
78+
name: java-coverage-report
79+
path: ${{ github.workspace }}/docs/coverage/java/target/site/jacoco-aggregate/
80+
81+
integration-test:
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v2
85+
with:
86+
submodules: 'true'
87+
- name: Set up JDK 11
88+
uses: actions/setup-java@v1
89+
with:
90+
java-version: '11'
91+
java-package: jdk
92+
architecture: x64
93+
- uses: actions/setup-python@v2
94+
with:
95+
python-version: '3.7'
96+
architecture: 'x64'
97+
- uses: actions/cache@v2
98+
with:
99+
path: ~/.m2/repository
100+
key: ${{ runner.os }}-it-maven-${{ hashFiles('**/pom.xml') }}
101+
restore-keys: |
102+
${{ runner.os }}-it-maven-
103+
- name: Set up gcloud SDK
104+
uses: google-github-actions/setup-gcloud@v0
105+
with:
106+
project_id: ${{ secrets.GCP_PROJECT_ID }}
107+
service_account_key: ${{ secrets.GCP_SA_KEY }}
108+
export_default_credentials: true
109+
- name: Use gcloud CLI
110+
run: gcloud info
111+
- name: Set up AWS SDK
112+
uses: aws-actions/configure-aws-credentials@v1
113+
with:
114+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
115+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
116+
aws-region: us-west-2
117+
- name: Use AWS CLI
118+
run: aws sts get-caller-identity
119+
- name: Run integration tests
120+
run: make test-java-integration
Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
name: java_complete
1+
name: java_pr
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- synchronize
8+
- labeled
49

510
jobs:
611
lint-java:
7-
container: gcr.io/kf-feast/feast-ci:latest
8-
runs-on: [ubuntu-latest]
12+
runs-on: ubuntu-latest
913
steps:
1014
- uses: actions/checkout@v2
1115
with:
@@ -45,16 +49,6 @@ jobs:
4549
|| (github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved')))
4650
runs-on: ubuntu-latest
4751
needs: unit-test-java
48-
services:
49-
redis:
50-
image: redis
51-
ports:
52-
- 6389:6379
53-
options: >-
54-
--health-cmd "redis-cli ping"
55-
--health-interval 10s
56-
--health-timeout 5s
57-
--health-retries 5
5852
steps:
5953
- uses: actions/checkout@v2
6054
with:

0 commit comments

Comments
 (0)