Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lijamie98 committed Nov 9, 2023
1 parent 8e595ea commit 090b2da
Show file tree
Hide file tree
Showing 9 changed files with 212 additions and 21 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: On Pull Request Workflow

on:
pull_request:

jobs:
gradle_build:
uses: ./.github/workflows/sub_gradle_build.yml

essential_tests:
needs: [ gradle_build ]
uses: ./.github/workflows/sub_essential_tests.yml

extended_tests:
needs: [ gradle_build ]
uses: ./.github/workflows/sub_extended_tests.yml

stellar_validation:
needs: [ gradle_build ]
uses: ./.github/workflows/sub_stellar_validation.yml

complete:
if: always()
needs: [ gradle_build, essential_tests, extended_tests, stellar_validation ]
runs-on: ubuntu-22.04
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
10 changes: 10 additions & 0 deletions .github/workflows/on_pull_request_comments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Pull Request Comments

on:
issue_comment:
types: [ created, edited ]

jobs:
check-comment:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/run-extended-tests')
uses: ./.github/workflows/sub_extended_tests.yml
File renamed without changes.
101 changes: 101 additions & 0 deletions .github/workflows/sub_essential_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Run Essential Tests Workflow

on:
# allows this workflow to be called from another workflow
workflow_dispatch:
workflow_call:

jobs:
essential_tests:
runs-on: ubuntu-latest-16-cores
# runs-on: ubuntu-latest
steps:
# Download the JAR from the previous workflow
- name: Download java-stellar-anchor-sdk.tar
uses: actions/download-artifact@v3
with:
name: java-stellar-anchor-sdk-tar
path: /home/runner/

- name: Extract java-stellar-anchor-sdk.tar
run: |
tar -xvf /home/runner/java-stellar-anchor-sdk.tar
ls -al /home/runner
ls -al /home/runner/java-stellar-anchor-sdk
ls -al /home/runner/java-stellar-anchor-sdk/service-runner
ls -al /home/runner/java-stellar-anchor-sdk/service-runner/src/main/resources/config/stellar.host.docker.internal.toml
cd /home/runner/java-stellar-anchor-sdk
# This is to add to DNS entries to access the services started by docker-compose.
# This should be deprecated. Refer to: https://stackoverflow.com/questions/47762339/how-to-correctly-set-up-docker-network-to-use-localhost-connection/47763442#47763442
- name: Set up hostnames (/etc/hosts)
run: |
sudo echo "127.0.0.1 db" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 zookeeper" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 kafka" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 sep24-reference-ui" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 reference-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 wallet-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 platform" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 custody-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts
- name: Run Zookeeper, Kafka, Postgres, and Sep24 UI with docker compose
env:
TEST_PROFILE_NAME: default
run: docker-compose -f /home/runner/java-stellar-anchor-sdk/service-runner/src/main/resources/docker-compose-test.yaml up -d --build

# Set up JDK 11
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Run sep server, platform server, observer, and reference servers for integration tests
env:
run_docker: false
run_all_servers: false
run_sep_server: true
run_platform_server: true
run_observer: true
run_kotlin_reference_server: true
run_event_processing_server: true
run_wallet_server: true

SEP1_TOML_VALUE: /home/runner/java-stellar-anchor-sdk/service-runner/src/main/resources/config/stellar.host.docker.internal.toml
SEP10_HOME_DOMAIN: host.docker.internal:8080
run: |
cp /home/runner/java-stellar-anchor-sdk/service-runner/build/libs/anchor-platform-runner-*.jar /home/runner/anchor-platform-runner.jar
java -jar /home/runner/anchor-platform-runner.jar -t &
echo "PID=$!" >> $GITHUB_ENV
- name: Wait for the sep server to start and get ready
uses: mydea/action-wait-for-api@v1
with:
url: "http://localhost:8080/.well-known/stellar.toml"
expected-status: "200"
timeout: "300"
interval: "1"

- name: Run Essential Tests
env:
run_docker: false
ANCHOR_DOMAIN: http://host.docker.internal:8080
run: |
cd /home/runner/java-stellar-anchor-sdk
pwd
ls -al .
./gradlew essential-tests:test
- name: Upload Essential Tests Report
if: always()
uses: actions/upload-artifact@v3
with:
name: essential-tests-report
path: |
/home/runner/work/java-stellar-anchor-sdk/java-stellar-anchor-sdk/api-schema/build/reports/
/home/runner/work/java-stellar-anchor-sdk/java-stellar-anchor-sdk/core/build/reports/
/home/runner/work/java-stellar-anchor-sdk/java-stellar-anchor-sdk/platform/build/reports/
/home/runner/work/java-stellar-anchor-sdk/java-stellar-anchor-sdk/essential-tests/build/reports/
13 changes: 13 additions & 0 deletions .github/workflows/sub_extended_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Run Extended Tests Workflow

on:
# allows this workflow to be called from another workflow
workflow_dispatch:
workflow_call:

jobs:
extended_tests:
runs-on: ubuntu-latest
steps:
- name: Run Extended Tests
run: echo "Running Extended Tests"
47 changes: 47 additions & 0 deletions .github/workflows/sub_gradle_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Anchor Platform Runnable Jar

on:
# allows this workflow to be called from another workflow
workflow_dispatch:
workflow_call:

jobs:
gradle_build:
name: Gradle Build and Unit Tests
runs-on: ubuntu-latest-16-cores
# write to PR permission is required for jacocoTestReport Action to update comment
permissions:
contents: read
pull-requests: write
steps:
# Checkout the code
- name: Checkout the repository
uses: actions/checkout@v3
with:
show-progress: false

# Set up JDK 11
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Gradle Build with unit tests only
env:
run_docker: false
run: ./gradlew clean build -x test -x essential-tests:test -x extended-tests:test --no-daemon --stacktrace -x spotlessApply -x spotlessKotlinApply -x javadoc -x javadocJar -x sourcesJar -x distTar -x distZip -x shadowJar -x shadowDistZip -x shadowDistTar -x bootDistTar -x bootDistZip

- name: Archive Project Folder
run: |
cd /home/runner/work/java-stellar-anchor-sdk
tar -cvf /home/runner/java-stellar-anchor-sdk.tar ./java-stellar-anchor-sdk
- name: Upload java-stellar-anchor-sdk.tar to GitHub Artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: java-stellar-anchor-sdk-tar
path: |
/home/runner/java-stellar-anchor-sdk.tar
# /home/runner/work/java-stellar-anchor-sdk/java-stellar-anchor-sdk/service-runner/build/libs/anchor-platform-runner-*.jar
13 changes: 13 additions & 0 deletions .github/workflows/sub_stellar_validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Run Extended Tests Workflow

on:
# allows this workflow to be called from another workflow
workflow_dispatch:
workflow_call:

jobs:
extended_tests:
runs-on: ubuntu-latest
steps:
- name: Run Stellar Validation
run: echo "Running Stellar Validation"
21 changes: 0 additions & 21 deletions .github/workflows/wf_pull_request.yml

This file was deleted.

0 comments on commit 090b2da

Please sign in to comment.