diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 10256a1..c9f6a4c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,13 @@ version: 2 updates: - - package-ecosystem: "github-actions" + - package-ecosystem: github-actions directory: "/" schedule: - interval: "daily" + interval: daily open-pull-requests-limit: 10 + + - package-ecosystem: gradle + directory: "/hedera-nft-auction-demo-java-node" + schedule: + interval: daily + open-pull-requests-limit: 5 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yaml similarity index 94% rename from .github/workflows/docker-publish.yml rename to .github/workflows/docker-publish.yaml index 1f9cbe8..04c59cf 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yaml @@ -4,11 +4,11 @@ on: release: # Publish `master` as Docker `latest` image. branches: - - master + - main # Publish `v1.2.3` tags as releases. - tags: - - v* +# tags: +# - v* workflow_dispatch: permissions: @@ -22,7 +22,7 @@ jobs: # Push image to GitHub Packages. # See also https://docs.docker.com/docker-hub/builds/ build_docker_images: - runs-on: [self-hosted, Linux, medium, ephemeral] + runs-on: nft-accelerators-linux-medium steps: - name: Set version run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV @@ -39,7 +39,7 @@ jobs: - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Checkout + - name: Checkout Code uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - name: Build java node image diff --git a/.github/workflows/system-test.yml b/.github/workflows/system-test.yaml similarity index 75% rename from .github/workflows/system-test.yml rename to .github/workflows/system-test.yaml index f0be405..2c6b075 100644 --- a/.github/workflows/system-test.yml +++ b/.github/workflows/system-test.yaml @@ -5,7 +5,8 @@ name: Java System CI with Gradle on: release: - branches: [ master ] + branches: + - main workflow_dispatch: permissions: @@ -14,33 +15,33 @@ permissions: defaults: run: shell: bash + working-directory: hedera-nft-auction-demo-java-node jobs: build: - - runs-on: [self-hosted, Linux, medium, ephemeral] - + name: Build + runs-on: nft-accelerators-linux-medium steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 - with: - path: | - ~/hedera-nft-auction-demo-java-node/.gradle/caches - ~/hedera-nft-auction-demo-java-node/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle-` + - name: Checkout Code + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + - name: Set up JDK 14 uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: java-version: '14' distribution: 'adopt' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + with: + gradle-version: wrapper + - name: Grant execute permission for gradlew - run: cd hedera-nft-auction-demo-java-node && chmod +x gradlew + run: chmod +x gradlew - name: Create certificates run: | - cd docker-files + cd ../docker-files openssl req -config certs.cnf -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem - name: Build with Gradle @@ -63,7 +64,7 @@ jobs: # only if participating in refund transactions TRANSFER_ON_WIN: true # auction topic details - TOPIC_ID: + TOPIC_ID: '' # mirror node detail # the mirror provider may be hedera, kabuto or dragonglass MIRROR_PROVIDER: hedera @@ -78,4 +79,4 @@ jobs: REST_HEDERA_TESTNET: testnet.mirrornode.hedera.com # REST_HEDERA_PREVIEWNET: previewnet.mirrornode.hedera.com REST_HEDERA_PREVIEWNET: 162.222.182.83 - run: cd hedera-nft-auction-demo-java-node && ./gradlew build testSystem + run: ./gradlew build testSystem diff --git a/.github/workflows/unit-integration-test.yaml b/.github/workflows/unit-integration-test.yaml new file mode 100644 index 0000000..2667e46 --- /dev/null +++ b/.github/workflows/unit-integration-test.yaml @@ -0,0 +1,87 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Java Unit+Integration Tests + +on: + workflow_dispatch: + pull_request: + branches: + - main + +permissions: + contents: read + +defaults: + run: + shell: bash + working-directory: hedera-nft-auction-demo-java-node + +jobs: + tests: + name: Tests + runs-on: nft-accelerators-linux-medium + steps: + - name: Checkout Code + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + + - name: Set up JDK 14 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + java-version: '14' + distribution: 'adopt' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + with: + gradle-version: wrapper + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Create certificates + run: | + cd ../docker-files + openssl req -config certs.cnf -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem + + - name: Build with Gradle + env: + OPERATOR_ID: ${{ secrets.OPERATOR_ID }} + OPERATOR_KEY: ${{ secrets.OPERATOR_KEY }} + NETWORK: testnet + # Run the REST API true/false + REST_API: true + API_PORT: 8081 + API_VERTICLE_COUNT: 1 + # Run the admin REST API true/false + ADMIN_API_PORT: 8082 + ADMIN_API_VERTICLE_COUNT: 1 + X_API_KEY: e6e006ec-c1ac-4204-9389-8d4ad4c12345 + NFT_STORAGE_API_KEY: ${{ secrets.NFT_STORAGE_API_KEY }} + HTTPS_KEY_OR_PASS: ../docker-files/key.pem + HTTPS_CERTIFICATE: ../docker-files/cert.pem + # Run the Auction Node true/false + AUCTION_NODE: true + # only if participating in refund transactions + REFUND_THREADS: 1 + TRANSFER_ON_WIN: true + # auction topic details + TOPIC_ID: '' + # mirror node detail + # the mirror provider may be hedera, kabuto or dragonglass + MIRROR_PROVIDER: hedera + MIRROR_QUERY_FREQUENCY: 5000 + # Database information for transaction and event logging + DATABASE_URL: postgresql://localhost:5432/ + POSTGRES_DB: nftauction + POSTGRES_USER: postgres + POSTGRES_PASSWORD: password + # REST Mirror urls + REST_HEDERA_MAINNET: mainnet.mirrornode.hedera.com + REST_HEDERA_TESTNET: testnet.mirrornode.hedera.com + # REST_HEDERA_PREVIEWNET: previewnet.mirrornode.hedera.com + REST_HEDERA_PREVIEWNET: 162.222.182.83 + run: ./gradlew build jacocoTestReport + + - name: Upload test reports + run: bash <(curl -s https://codecov.io/bash) -f build/reports/jacoco/report.xml diff --git a/.github/workflows/unit-integration-test.yml b/.github/workflows/unit-integration-test.yml deleted file mode 100644 index a317b1b..0000000 --- a/.github/workflows/unit-integration-test.yml +++ /dev/null @@ -1,89 +0,0 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Java Unit+Integration Tests - -on: - workflow_dispatch: - pull_request: - branches: [ master ] - -permissions: - contents: read - -defaults: - run: - shell: bash - -jobs: - build: - - runs-on: [self-hosted, Linux, medium, ephemeral] - - steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - - - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 - with: - path: | - ~/hedera-nft-auction-demo-java-node/.gradle/caches - ~/hedera-nft-auction-demo-java-node/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle-` - - - name: Set up JDK 14 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 - with: - java-version: '14' - distribution: 'adopt' - - - name: Grant execute permission for gradlew - run: cd hedera-nft-auction-demo-java-node && chmod +x gradlew - - - name: Create certificates - run: | - cd docker-files - openssl req -config certs.cnf -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem - - - name: Build with Gradle - env: - OPERATOR_ID: ${{ secrets.OPERATOR_ID }} - OPERATOR_KEY: ${{ secrets.OPERATOR_KEY }} - NETWORK: testnet - # Run the REST API true/false - REST_API: true - API_PORT: 8081 - API_VERTICLE_COUNT: 1 - # Run the admin REST API true/false - ADMIN_API_PORT: 8082 - ADMIN_API_VERTICLE_COUNT: 1 - X_API_KEY: e6e006ec-c1ac-4204-9389-8d4ad4c12345 - NFT_STORAGE_API_KEY: ${{ secrets.NFT_STORAGE_API_KEY }} - HTTPS_KEY_OR_PASS: ../docker-files/key.pem - HTTPS_CERTIFICATE: ../docker-files/cert.pem - # Run the Auction Node true/false - AUCTION_NODE: true - # only if participating in refund transactions - REFUND_THREADS: 1 - TRANSFER_ON_WIN: true - # auction topic details - TOPIC_ID: - # mirror node detail - # the mirror provider may be hedera, kabuto or dragonglass - MIRROR_PROVIDER: hedera - MIRROR_QUERY_FREQUENCY: 5000 - # Database information for transaction and event logging - DATABASE_URL: postgresql://localhost:5432/ - POSTGRES_DB: nftauction - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - # REST Mirror urls - REST_HEDERA_MAINNET: mainnet.mirrornode.hedera.com - REST_HEDERA_TESTNET: testnet.mirrornode.hedera.com - # REST_HEDERA_PREVIEWNET: previewnet.mirrornode.hedera.com - REST_HEDERA_PREVIEWNET: 162.222.182.83 - run: cd hedera-nft-auction-demo-java-node && ./gradlew build jacocoTestReport - - - name: Upload test reports - run: cd hedera-nft-auction-demo-java-node && bash <(curl -s https://codecov.io/bash) -f build/reports/jacoco/report.xml