forked from indigo-dc/orchestrator-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (41 loc) · 1.53 KB
/
main.yaml
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
name: Test IM-Dashboard
on:
push:
branches: ["master", "egi_brand"]
pull_request:
branches: ["master", "egi_brand"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: python -m pip install pycodestyle
- name: Check code style
run: pycodestyle --max-line-length=120 --ignore=E402,W504 . --exclude=doc
- name: Install dependencies
run: |
sed -i -e 's|mysqlclient.*|PyMySQL|g' requirements.txt
pip install -r requirements.txt
pip install pymongo coverage nose mock
- name: Prepare environment
run: |
cp app/config-sample.json app/config.json
mkdir tosca-templates
wget -P tosca-templates https://raw.githubusercontent.com/grycap/tosca/main/templates/simple-node-disk.yml
sed -i -e 's|/opt|'${GITHUB_WORKSPACE}'|g' app/config.json
sed -i -e 's|creds.db|tmp/creds.db|g' app/config.json
- name: Unit tests
run: python -m coverage run --source=. -m unittest discover -s app/tests -p 'test*.py'
- name: Generate XML coverage report
run: python -m coverage xml
- name: Report coverage
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml