-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path18754.yml
67 lines (64 loc) · 2.33 KB
/
18754.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
name: WD-201 | L2 Milestone
on:
push:
branches: ["submission-*"]
env:
REVIEW_END_POINT: ${{ secrets.REVIEW_END_POINT }}
REVIEW_BOT_USER_TOKEN: ${{ secrets.REVIEW_BOT_USER_TOKEN }}
jobs:
tests:
timeout-minutes: 10
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/index.js
http-server/home.html
http-server/package.json
http-server/project.html
http-server/registration.html
- name: Check out the solutions repo
if: ${{ steps.check-student-repo.outputs.result == 'success' }}
id: checkout-solutions-repo
uses: actions/checkout@v2
with:
repository: pupilfirst/wd201-tests
path: solution
- name: Copy test files to submission repo
if: steps.checkout-solutions-repo.outcome == 'success'
continue-on-error: true
run: |
cp -r solution/l2/cypress submission/http-server
cp solution/l2/cypress.config.js submission/http-server
cp solution/l2/generateReportFromResults.js submission/http-server
cp solution/l2/package-lock.json submission/http-server
cp solution/l2/package.json submission/http-server
- name: Run tests in the solution repo
if: steps.checkout-solutions-repo.outcome == 'success'
continue-on-error: true
timeout-minutes: 2
id: run-cypress-test
run: |
cd submission/http-server
npm install
npm run test
- name: Use Node.js to generate report
if: steps.checkout-solutions-repo.outcome == 'success'
id: generate-report
continue-on-error: true
run: |
cd submission/http-server && 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: "submission/http-server/report.json"
env:
REVIEW_END_POINT: ${{ secrets.REVIEW_END_POINT }}
REVIEW_BOT_USER_TOKEN: ${{ secrets.REVIEW_BOT_USER_TOKEN }}