forked from the-nft-company/flow-jvm-sdk
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b769cd9
commit 1521184
Showing
2 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Build Java Examples Pull Request | ||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
name: Build pull request | ||
runs-on: ubuntu-latest | ||
env: | ||
JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false | ||
#services: | ||
# flow-emulator: | ||
# image: gcr.io/flow-container-registry/emulator | ||
# env: | ||
# FLOW_VERBOSE: true | ||
# FLOW_PORT: 3569 | ||
# FLOW_INTERVAL: 5s | ||
# FLOW_PERSIST: false | ||
# ports: | ||
# - 3569:3569 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '21' | ||
java-package: jdk | ||
distribution: 'adopt' | ||
|
||
- name: Install flow emulator | ||
run: sh -ci "$(curl -fsSL https://storage.googleapis.com/flow-cli/install.sh)" | ||
|
||
- name: Make gradle executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Build | ||
id: build | ||
run: ./gradlew --warning-mode all check :java-example:build -x test -x integrationTest | ||
|
||
- name: Start emulator | ||
id: start_emulator | ||
if: ${{ steps.build.outcome == 'success' }} | ||
run: | | ||
nohup flow emulator start -v > flow-emulator.log 2>&1 & | ||
- name: Wait for emulator to start | ||
id: wait_for_emulator | ||
if: ${{ steps.start_emulator.outcome == 'success' }} | ||
run: sleep 15 | ||
|
||
- name: Run Java Example Unit Tests | ||
id: unit_test | ||
if: ${{ steps.wait_for_emulator.outcome == 'success' }} | ||
run: ./gradlew --no-daemon --max-workers=2 --warning-mode=all :java-example:test -i --continue --stacktrace | ||
|
||
- name: Publish Java Example Unit Test Results | ||
uses: EnricoMi/[email protected] | ||
if: always() | ||
with: | ||
check_name: "Unit Test Results" | ||
files: "**/test-results/test/**/*.xml" | ||
seconds_between_github_writes: 5 | ||
secondary_rate_limit_wait_seconds: 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,12 +49,12 @@ jobs: | |
if: ${{ steps.start_emulator.outcome == 'success' }} | ||
run: sleep 15 | ||
|
||
- name: Run Unit Tests | ||
- name: Run Kotlin Example Unit Tests | ||
id: unit_test | ||
if: ${{ steps.wait_for_emulator.outcome == 'success' }} | ||
run: ./gradlew --no-daemon --max-workers=2 --warning-mode=all :kotlin-example:test -i --continue --stacktrace | ||
|
||
- name: Publish Unit Test Results | ||
- name: Publish Kotlin Example Unit Test Results | ||
uses: EnricoMi/[email protected] | ||
if: always() | ||
with: | ||
|