-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (86 loc) · 2.69 KB
/
ci.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
81
82
83
84
85
86
87
88
name: CI
on:
push:
jobs:
test:
strategy:
matrix:
python-version: ["3.7.1", "3.10"]
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
-
name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
-
name: Display system info
run: |
python -c "import sys; print(sys.version)"
docker --version
docker-compose --version
-
name: Install dependencies
env:
MODELICAPATH: /home/runner/work/modelica-buildings
run: |
git clone --single-branch --branch maint_9.1.x https://github.com/lbl-srg/modelica-buildings.git $MODELICAPATH
# back in the main checkout install Python dependencies
pip install --upgrade pip
pip install poetry
poetry install
-
name: Run unittests
env:
MODELICAPATH: /home/runner/work/modelica-buildings
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
poetry run py.test . -v --cov --cov-report term-missing
-
name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.python_version == '3.10' }}
# https://github.com/TheKevJames/coveralls-python/issues/252
run: |
poetry run coveralls --service=github
-
name: Job Failed
if: ${{ failure() }}
run: |
echo "Maybe these logs will help?"
free -tm
ls -alt $GITHUB_WORKSPACE
echo "============================================ stdout.log ========================================="
find $GITHUB_WORKSPACE -type f -name 'stdout.log' -print | while read filename; do
echo "$filename"
cat "$filename"
done
-
name: Store test output
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: test-output
path: output
formatting:
strategy:
matrix:
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7.1'
- name: Install deps
run: |
pip install --upgrade pip
pip install poetry
poetry install
- name: Run pre-commit
run: |
poetry run pre-commit run --show-diff-on-failure --color=always --all-files