-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path18757.yml
82 lines (79 loc) · 2.53 KB
/
18757.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: WD201 Node.js - L5 Milestone
on:
push:
branches: ["submission-*"]
env:
REVIEW_END_POINT: ${{ secrets.REVIEW_END_POINT }}
REVIEW_BOT_USER_TOKEN: ${{ secrets.REVIEW_BOT_USER_TOKEN }}
PG_DATABASE: todo_db_test
PG_USER: postgres
PG_PASSWORD: postgres
jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 10
services:
postgres:
image: postgres:15.2
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: todo_db_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout student repo and verify its structure
id: check-student-repo
uses: pupilfirst/check-repo-action@v1
with:
repoPath: submission
globs: |-
.gitignore
hello-world/*
http-server/*
todo-cli/.husky/pre-commit
todo-cli/__tests__/todo.js
todo-cli/.eslintrc.json
todo-cli/package.json
todo-cli/package-lock.json
todo-cli/listTodos.js
todo-cli/completeTodo.js
todo-cli/addTodo.js
todo-cli/migrations/*-create-todo.js
todo-cli/models/index.js
todo-cli/models/todo.js
- name: Check out the solutions repo
if: ${{ steps.check-student-repo.outputs.result == 'success' }}
uses: actions/checkout@v2
id: checkout-solutions-repo
with:
repository: pupilfirst/wd201-tests
path: solution
- name: Copy submission files to solution
if: steps.checkout-solutions-repo.outcome == 'success'
id: copy-submission-files
run: |
cp submission/todo-cli/models/todo.js solution/l5/models/todo.js
- name: Run tests in the solution repo
continue-on-error: true
if: steps.copy-submission-files.outcome == 'success'
timeout-minutes: 2
run: |
cd solution/l5
npm install
npm run test
- name: Use Node.js to generate report
if: steps.copy-submission-files.outcome == 'success'
id: generate-report
run: |
cd solution/l5 && node generateReportFromResults.js
- name: Grade the submission based on test results
uses: pupilfirst/grade-action@v1
if: steps.generate-report.outcome == 'success'
with:
report_file_path: "solution/l5/report.json"