Skip to content

chore: fix logic error #6

chore: fix logic error

chore: fix logic error #6

Workflow file for this run

name: Autograding Tests
'on':
- push
- repository_dispatch
permissions:
checks: write
actions: read
contents: read
jobs:
run-autograding-tests:
runs-on: ubuntu-latest
if: github.actor != 'github-classroom[bot]'
steps:
- name: Code Verification
uses: actions/checkout@v4
- name: Foundry Installation
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Forge Installation
run: |
cd hw
forge install
id: test
## Problem Template
# - name: Problem <id>
# id: problem-<id>
# uses: classroom-resources/autograding-command-grader@v1
# with:
# test-name: Problem <id>
# command: cd hw && forge test --mt <foundry-test-name>
# timeout: <time-limit>
# max-score: <max-score>
## LiaoToken
- name: LiaoToken
id: problem-1-1
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: LiaoToken::transfer
command: cd hw && forge test --mc LiaoTokenTest --mt test_check_transfer_points
timeout: 10
max-score: 5
- name: LiaoToken
id: problem-1-2
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: LiaoToken::approve
command: cd hw && forge test --mc LiaoTokenTest --mt test_check_approve_points
timeout: 10
max-score: 5
- name: LiaoToken
id: problem-1-3
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: LiaoToken::transferFrom
command: cd hw && forge test --mc LiaoTokenTest --mt test_check_transferFrom_points
timeout: 10
max-score: 5
## NFinTech
- name: NFinTech
id: problem-2-1
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: NFinTech::approve
command: cd hw && forge test --mc NFinTechTest --mt test_check_approve_function
timeout: 10
max-score: 5
- name: NFinTech
id: problem-2-2
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: NFinTech::setApproveForAll
command: cd hw && forge test --mc NFinTechTest --mt test_check_setApproveForAll
timeout: 10
max-score: 5
- name: NFinTech
id: problem-2-3
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: NFinTech::transferFrom
command: cd hw && forge test --mc NFinTechTest --mt test_check_transferFrom_points
timeout: 10
max-score: 5
- name: NFinTech
id: problem-2-4
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: NFinTech::safeTransferFrom
command: cd hw && forge test --mc NFinTechTest --mt test_check_safeTransferFrom
timeout: 10
max-score: 5
- name: NFinTech
id: problem-2-5
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: NFinTech::Mix
command: cd hw && forge test --mc NFinTechTest --mt test_check_mix_operation
timeout: 10
max-score: 10
## Loan
- name: Loan
id: problem-3-1
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: Loan::BadCaller
command: cd hw && forge test --mc BadCallerTest --mt testExploit
timeout: 10
max-score: 10
- name: Loan
id: problem-3-2
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: Loan::BadLender
command: cd hw && forge test --mc BadLenderTest --mt testExploit
timeout: 10
max-score: 10
- name: Delegation
id: problem-4-1
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: Delegation::Bank
command: cd hw && forge test --mc BankTest --mt testExploit
timeout: 10
max-score: 10
- name: Bank
id: problem-4-2
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: Delegation::UntrustedOracle
command: cd hw && forge test --mc UntrustedOracleTest --mt testExploit
timeout: 10
max-score: 10
- name: Vault
id: problem-5
uses: classroom-resources/autograding-command-grader@v1
with:
test-name: Vault
command: cd hw && forge test --mc VaultTest --mt testExploit
timeout: 10
max-score: 15
## Modify Autograding Reporter
## If new problems are added, remember to add new grading actions below
- name: Autograding Reporter
uses: classroom-resources/autograding-grading-reporter@v1
env:
PROBLEM-1-1_RESULTS: "${{steps.problem-1-1.outputs.result}}"
PROBLEM-1-2_RESULTS: "${{steps.problem-1-2.outputs.result}}"
PROBLEM-1-3_RESULTS: "${{steps.problem-1-3.outputs.result}}"
PROBLEM-2-1_RESULTS: "${{steps.problem-2-1.outputs.result}}"
PROBLEM-2-2_RESULTS: "${{steps.problem-2-2.outputs.result}}"
PROBLEM-2-3_RESULTS: "${{steps.problem-2-3.outputs.result}}"
PROBLEM-2-4_RESULTS: "${{steps.problem-2-4.outputs.result}}"
PROBLEM-2-5_RESULTS: "${{steps.problem-2-5.outputs.result}}"
PROBLEM-3-1_RESULTS: "${{steps.problem-3-1.outputs.result}}"
PROBLEM-3-2_RESULTS: "${{steps.problem-3-2.outputs.result}}"
PROBLEM-4-1_RESULTS: "${{steps.problem-4-1.outputs.result}}"
PROBLEM-4-2_RESULTS: "${{steps.problem-4-2.outputs.result}}"
PROBLEM-5_RESULTS: "${{steps.problem-5.outputs.result}}"
with:
runners: problem-1-1, problem-1-2, problem-1-3, problem-2-1, problem-2-2, problem-2-3, problem-2-4, problem-2-5, problem-3-1, problem-3-2, problem-4-1, problem-4-2, problem-5