-
Notifications
You must be signed in to change notification settings - Fork 13
80 lines (73 loc) · 1.89 KB
/
test.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
name: Test
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
frontend_test:
name: Frontend Test
runs-on: ubuntu-18.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install dependencies
run: |
npm install .
working-directory: ./frontend
- name: Build
run: |
npm run build
working-directory: ./frontend
# This globstar only works in bash
- name: Lint
run: |
shopt -s globstar
npm run lint src/**/*.vue src/**/*.js
working-directory: ./frontend
backend_test:
name: Backend Test
runs-on: ubuntu-18.04
env:
VERILOG_OJ_DEV: "TRUE"
VERILOG_OJ_JUDGER_SECRET: "SOMETHING"
VERILOG_OJ_SECRET_KEY: "SOMETHING"
VERILOG_OJ_PUBLIC_HOST: "abc.example.com"
VERILOG_OJ_RABBITMQ_PASSWORD: "SOMETHING"
DOCKER_JUDGER_HOST_PATH: "/some/path"
DOCKER_HOST_DIR: "/some/dir"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r backend/requirements.txt
pip install coverage coveralls
- name: Prepare database
run: |
python manage.py migrate
working-directory: ./backend
- name: Run test
run: |
python manage.py test
working-directory: ./backend
- name: Run coverage
run: |
coverage run --source='.' manage.py test
coveralls --output="lcov.info"
working-directory: ./backend
- name: Upload Coverage
run: |
COVERALLS_REPO_TOKEN=$COVERALLS_TOKEN coveralls
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
working-directory: ./backend