Skip to content

Merge pull request #151 from zhangcongcobo/main #436

Merge pull request #151 from zhangcongcobo/main

Merge pull request #151 from zhangcongcobo/main #436

Workflow file for this run

# 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 Unittest
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run tests against'
default: develop
type: choice
options:
- develop
- prod
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: |
chmod +x gradlew
- name: run testcase
env:
ENV: "${{ github.event.inputs.environment == 'prod' && 'prod' || 'develop'}}"
SECRET: "${{ github.event.inputs.environment == 'prod' && secrets.PRODSECRET || secrets.DEVELOPSECRET}}"
Web3SECRET: "${{secrets.DEVELOPWEB3SECRET}}"
MPCSECRET: "${{secrets.DEVELOPMPCSECRET}}"
run: ./gradlew cleanTest test -DEnv=$ENV -DApiSecret=$SECRET -DMPCApiSecret=$MPCSECRET