Skip to content

Commit 7663443

Browse files
authored
Merge pull request #2 from Imperial-MATH50009/main
Autograding updates.
2 parents da28c63 + ca90aa1 commit 7663443

File tree

3 files changed

+94
-17
lines changed

3 files changed

+94
-17
lines changed

.github/classroom/autograding.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
},
1313
{
1414
"name": "package-install",
15-
"setup": "/venv/bin/python -m pip install -U pip",
16-
"run": "/venv/bin/python -m pip install -e .",
15+
"setup": "venv/bin/python -m pip install -U pip",
16+
"run": "venv/bin/python -m pip install -e .",
1717
"input": "",
1818
"output": "",
1919
"comparison": "included",
@@ -23,7 +23,7 @@
2323
{
2424
"name": "exercise-6-1",
2525
"setup": "",
26-
"run": "pytest tests/test_exercise_6_1.py",
26+
"run": "venv/bin/python -m pytest tests/test_exercise_6_1.py",
2727
"input": "",
2828
"output": "",
2929
"comparison": "included",
@@ -53,12 +53,12 @@
5353
{
5454
"name": "flake8-test",
5555
"setup": "",
56-
"run": "python3 -m flake8 nonlinear_solvers/",
56+
"run": "venv/bin/python -m flake8 nonlinear_solvers/",
5757
"input": "",
5858
"output": "",
5959
"comparison": "included",
6060
"timeout": 1,
6161
"points": 1
6262
}
6363
]
64-
}
64+
}

.github/workflows/classroom.yml

Lines changed: 85 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,85 @@
1-
name: GitHub Classroom Workflow
2-
3-
on: [push]
4-
5-
jobs:
6-
build:
7-
name: Autograding
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v4
11-
- uses: education/autograding@v1
1+
name: Autograding Tests
2+
'on':
3+
- push
4+
- repository_dispatch
5+
permissions:
6+
actions: read
7+
checks: write
8+
contents: read
9+
jobs:
10+
run-autograding-tests:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Install Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.12'
19+
- id: setup
20+
name: setup
21+
uses: classroom-resources/autograding-command-grader@v1
22+
with:
23+
command: venv/bin/python -m pip install setuptools pytest flake8 pep8-naming
24+
flake8-docstrings numpy
25+
max-score: null
26+
setup-command: python3 -m venv venv
27+
test-name: setup
28+
timeout: 1
29+
- id: package-install
30+
name: package-install
31+
uses: classroom-resources/autograding-command-grader@v1
32+
with:
33+
command: venv/bin/python -m pip install -e .
34+
max-score: null
35+
setup-command: venv/bin/python -m pip install -U pip
36+
test-name: package-install
37+
timeout: 1
38+
- id: exercise-6-1
39+
name: exercise-6-1
40+
uses: classroom-resources/autograding-command-grader@v1
41+
with:
42+
command: venv/bin/python -m pytest tests/test_exercise_6_1.py
43+
max-score: 1
44+
setup-command: ''
45+
test-name: exercise-6-1
46+
timeout: 1
47+
- id: exercise-6-2
48+
name: exercise-6-2
49+
uses: classroom-resources/autograding-command-grader@v1
50+
with:
51+
command: venv/bin/python -m pytest tests/test_exercise_6_2.py
52+
max-score: 1
53+
setup-command: ''
54+
test-name: exercise-6-2
55+
timeout: 1
56+
- id: exercise-6-3
57+
name: exercise-6-3
58+
uses: classroom-resources/autograding-command-grader@v1
59+
with:
60+
command: venv/bin/python -m pytest tests/test_exercise_6_3.py
61+
max-score: 1
62+
setup-command: ''
63+
test-name: exercise-6-3
64+
timeout: 1
65+
- id: flake8-test
66+
name: flake8-test
67+
uses: classroom-resources/autograding-command-grader@v1
68+
with:
69+
command: venv/bin/python -m flake8 nonlinear_solvers/
70+
max-score: 1
71+
setup-command: ''
72+
test-name: flake8-test
73+
timeout: 1
74+
- env:
75+
EXERCISE-6-1_RESULTS: ${{steps.exercise-6-1.outputs.result}}
76+
EXERCISE-6-2_RESULTS: ${{steps.exercise-6-2.outputs.result}}
77+
EXERCISE-6-3_RESULTS: ${{steps.exercise-6-3.outputs.result}}
78+
FLAKE8-TEST_RESULTS: ${{steps.flake8-test.outputs.result}}
79+
PACKAGE-INSTALL_RESULTS: ${{steps.package-install.outputs.result}}
80+
SETUP_RESULTS: ${{steps.setup.outputs.result}}
81+
name: Autograding Reporter
82+
uses: classroom-resources/autograding-grading-reporter@v1
83+
with:
84+
runners: setup, package-install, exercise-6-1, exercise-6-2, exercise-6-3,
85+
flake8-test

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "nonlinear-solvers"
7-
version = "0.1"
7+
version = "0.1"
8+
9+
[tool.hatch.build.targets.wheel]
10+
packages = ["nonlinear_solvers"]

0 commit comments

Comments
 (0)