Merge pull request #171 from yangmingcobo/main #487
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
# 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 |