Add Ranking Component #21
Workflow file for this run
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
name: Calculate Score | |
on: push | |
jobs: | |
calculate-score: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current time | |
id: current-time | |
run: echo "::set-output name=time::$(date -u +'%H:%M:%S' -d '+9 hours')" | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "zulu" | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Run all local screenshot tests (Roborazzi) | |
run: ./gradlew recordRoborazziDebug | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
pip install -r score-calculation/requirements.txt | |
- name: Calculate MS-SSIM | |
run: python score-calculation/calculate.py | |
- name: Calculate score | |
run: echo "result=$(python score-calculation/calculate.py)" >> $GITHUB_ENV | |
- name: Discord Notification | |
uses: appleboy/discord-action@master | |
with: | |
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }} | |
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} | |
message: "Result: ${{ env.result }} by @${{ github.actor }} at ${{ steps.current-time.outputs.time }}" | |
file: "question/img/except.png,app/build/outputs/roborazzi/com.github.nidroid.uiperfectcopycontesttest.ExampleUnitTest.yourAnswerTest.png" | |
- name: Upload screenshot | |
uses: actions/upload-artifact@v4 | |
with: | |
name: screenshot_result | |
path: app/build/outputs/roborazzi |