-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path18760.yml
105 lines (102 loc) · 3.88 KB
/
18760.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: WD201 Node.js - L8 Milestone
on:
push:
branches: ["submission-*"]
env:
REVIEW_END_POINT: ${{ secrets.REVIEW_END_POINT }}
REVIEW_BOT_USER_TOKEN: ${{ secrets.REVIEW_BOT_USER_TOKEN }}
jobs:
extract_url:
runs-on: ubuntu-latest
outputs:
outcome: ${{steps.get-submission-url.outcome}}
submissionUrl: ${{steps.get-submission-url.outputs.result}}
steps:
- name: Check out the parent repository with student submission data
uses: actions/checkout@v2
- name: Extract the student submission URL
uses: actions/github-script@v5
id: get-submission-url
continue-on-error: true
with:
script: |
const submission = require('./submission.json')
return submission.checklist[1].result
result-encoding: string
- name: Report invalid repository URL in submission
if: steps.get-submission-url.outcome != 'success'
uses: pupilfirst/grade-action@v1
with:
fail_submission: true
feedback: We failed to extract the URL for your live web application from your submission. Please submit again; if this issue persists, please reach out to our team for support.
tests:
needs: extract_url
timeout-minutes: 10
if: needs.extract_url.outputs.outcome == 'success'
runs-on: ubuntu-latest
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/*
todo-app/__tests__/todos.js
todo-app/.husky/pre-commit
todo-app/models/index.js
todo-app/models/todo.js
todo-app/migrations/*-create-todo.js
todo-app/public/css/styles.css
todo-app/views/footer.ejs
todo-app/views/header.ejs
todo-app/views/index.ejs
todo-app/views/todos.ejs
todo-app/app.js
todo-app/index.js
todo-app/package.json
todo-app/package-lock.json
- name: Report to LMS that tests are in progress
if: steps.check-student-repo.outputs.result == 'success'
uses: pupilfirst/report-action@v1
with:
status: "in_progress"
description: "Automated tests are in progress"
- name: Check out the repository with solutions and tests
if: steps.check-student-repo.outputs.result == 'success'
id: checkout-solutions-repo
uses: actions/checkout@v2
with:
repository: "pupilfirst/wd201-tests"
path: solution
- name: Hack to run cypress on root
if: steps.checkout-solutions-repo.outcome == 'success'
run: |
cp solution/l8/package.json package.json
cp solution/l8/package-lock.json package-lock.json
- name: Cypress run with env
if: steps.checkout-solutions-repo.outcome == 'success'
uses: cypress-io/github-action@v4
timeout-minutes: 2
continue-on-error: true
with:
browser: chrome
project: ./solution/l8
env: STUDENT_SUBMISSION_URL=${{needs.extract_url.outputs.submissionUrl}}
- name: Use Node.js to generate report
if: steps.checkout-solutions-repo.outcome == 'success'
run: |
cd solution/l8 && node generateReportFromResults.js
- name: Grade the submission based on test results
if: steps.checkout-solutions-repo.outcome == 'success'
uses: pupilfirst/grade-action@v1
with:
report_file_path: "solution/l8/report.json"
- name: Report to LMS the outcome of tests.
if: steps.checkout-solutions-repo.outcome == 'success'
uses: pupilfirst/report-action@v1
with:
report_file_path: "solution/l8/report.json"