Skip to content

Commit

Permalink
Reverted some changes because secrets can not be transferred to fork
Browse files Browse the repository at this point in the history
Signed-off-by: Theodor Mihalache <[email protected]>
  • Loading branch information
tmihalac committed Sep 23, 2024
1 parent a9c60a4 commit ea7bf12
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/java_pr.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
name: java_pr

on:
pull_request:
pull_request_target:
types:
- opened
- synchronize
- labeled

jobs:
lint-java:
# when using pull_request, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
# when using pull_request_target, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.repository.full_name }} # Uses the full repository name
ref: ${{ github.ref }} # Uses the ref from the event
token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided token
# pull_request_target runs the workflow in the context of the base repo
# as such actions/checkout needs to be explicit configured to retrieve
# code from the PR.
ref: refs/pull/${{ github.event.pull_request.number }}/merge
submodules: recursive
- name: Lint java
run: make lint-java

unit-test-java:
# when using pull_request, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
# when using pull_request_target, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest
needs: lint-java
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.repository.full_name }} # Uses the full repository name
ref: ${{ github.ref }} # Uses the ref from the event
token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided token
# pull_request_target runs the workflow in the context of the base repo
# as such actions/checkout needs to be explicit configured to retrieve
# code from the PR.
ref: refs/pull/${{ github.event.pull_request.number }}/merge
submodules: recursive
- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down Expand Up @@ -66,11 +68,11 @@ jobs:
path: ${{ github.workspace }}/docs/coverage/java/target/site/jacoco-aggregate/

build-docker-image-java:
# when using pull_request, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
# when using pull_request_target, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -101,21 +103,22 @@ jobs:
run: make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${GITHUB_SHA}

integration-test-java-pr:
# when using pull_request, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
# when using pull_request_target, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
github.repository == 'feast-dev/feast'
runs-on: ubuntu-latest
needs: unit-test-java
env:
PYTHON: 3.11
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.repository.full_name }} # Uses the full repository name
ref: ${{ github.ref }} # Uses the ref from the event
token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided token
# pull_request_target runs the workflow in the context of the base repo
# as such actions/checkout needs to be explicit configured to retrieve
# code from the PR.
ref: refs/pull/${{ github.event.pull_request.number }}/merge
submodules: recursive
- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/pr_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pr-integration-tests

on:
pull_request:
pull_request_target:
types:
- opened
- synchronize
Expand All @@ -14,11 +14,11 @@ on:

jobs:
integration-test-python:
# when using pull_request, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
# when using pull_request_target, all jobs MUST have this if check for 'ok-to-test' or 'approved' for security purposes.
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
github.repository == 'feast-dev/feast'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -41,9 +41,10 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.repository.full_name }} # Uses the full repository name
ref: ${{ github.ref }} # Uses the ref from the event
token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided token
# pull_request_target runs the workflow in the context of the base repo
# as such actions/checkout needs to be explicit configured to retrieve
# code from the PR.
ref: refs/pull/${{ github.event.pull_request.number }}/merge
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
Expand Down

0 comments on commit ea7bf12

Please sign in to comment.