-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (74 loc) · 2.58 KB
/
run_tests.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
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2022 Arcangelo Massari <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted, provided that the above copyright notice
# and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.
name: Run tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
CheckCoverage:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install poetry
poetry install
- name: Run Blazegraph
run: |
wget https://github.com/blazegraph/database/releases/download/BLAZEGRAPH_2_1_6_RC/blazegraph.jar
java -server -jar blazegraph.jar &
python3 -c 'import time; time.sleep(15)'
- name: Check the overage
run: |
poetry run coverage run --rcfile=oc_ocdm/test/coverage/.coveragerc
- name: Generate the badge
run: |
mv .coverage oc_ocdm/test/coverage/
cd oc_ocdm/test/coverage/
rm coverage.svg
poetry run coverage-badge -o coverage.svg
- uses: actions/[email protected]
with:
name: coverage-artifact
path: oc_ocdm/test/coverage/
PublishBadge:
runs-on: ubuntu-latest
needs: CheckCoverage
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
name: coverage-artifact
path: oc_ocdm/test/coverage/
- name: Publish the badge on the GitHub repo
run: |
git pull
git add oc_ocdm/test/coverage/.coverage
git add oc_ocdm/test/coverage/coverage.svg
git config --global user.name 'arcangelo7'
git config --global user.email '[email protected]'
git commit -m 'Coverage updated'
git push