-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 1.12 KB
/
workflow-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: overmind-submission-run-tests
run-name: Run tests for quest submission
on:
workflow_dispatch:
inputs:
secretKey:
description: "Secret key sent to webhook to prevent maliciously calling webhook"
required: true
default: "INVALID_KEY"
questId:
description: "questId of submission"
required: true
userId:
description: "userId of submission"
required: true
jobs:
run-tests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- run: brew install aptos
- name: Run aptos move test
run: aptos move test --ignore-compile-warnings > output.txt
continue-on-error: true
- name: Call webhook
run: |
webhook_url="https://mod.overmind.xyz/api/handle-test-run"
output=$(cat output.txt)
json_payload=$(python3 -c "import json, sys; print(json.dumps({'output': sys.argv[1], 'secretKey': '${{inputs.secretKey}}', 'questId': '${{inputs.questId}}', 'userId': '${{inputs.userId}}' }))" "$output")
curl -X POST -H "Content-Type: application/json" -d "$json_payload" "$webhook_url"