Skip to content

Commit

Permalink
Merge pull request #500 from grycap/devel
Browse files Browse the repository at this point in the history
Move tests to actions
  • Loading branch information
micafer authored Feb 15, 2024
2 parents df194b5 + e4bb71f commit e7dfacf
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test IM-Dashboard

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IM-Dashboard

[![Build Status](https://jenkins.i3m.upv.es/buildStatus/icon?job=grycap/im-dashboard-unit/)](https://jenkins.i3m.upv.es/job/grycap/job/im-dashboard-unit//)
[![Tests](https://github.com/grycap/im-dashboard/actions/workflows/main.yaml/badge.svg)](https://github.com/grycap/im-dashboard/actions/workflows/main.yaml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/c985310233c34f0aa6699cc9b167fba0)](https://www.codacy.com/gh/grycap/im-dashboard/dashboard?utm_source=github.com&utm_medium=referral&utm_content=grycap/im-dashboard&utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/c985310233c34f0aa6699cc9b167fba0)](https://www.codacy.com/gh/grycap/im-dashboard/dashboard?utm_source=github.com&utm_medium=referral&utm_content=grycap/im-dashboard&utm_campaign=Badge_Coverage)
[![License](https://img.shields.io/badge/license-GPL%20v3.0-brightgreen.svg)](LICENSE)
Expand Down

0 comments on commit e7dfacf

Please sign in to comment.