-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (110 loc) · 4.95 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Test
# Look at this: https://github.com/iterative/dvc/pull/7213
# Forum: https://discuss.dvc.org/t/cml-github-actions-google-drive-service-account/795/3?fbclid=IwAR21DBJ3bP2m3VwZ7EUp4U1ik0YQbNRgAIdemg14msCC7UtnaBao81oTTDE
# https://github.com/iterative/cml#using-cml-with-dvc
# https://github.com/iterative/dvc.org/blob/master/content/docs/user-guide/setup-google-drive-remote.md
# https://www.ravirajag.dev/blog/mlops-github-actions
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
RUNNING_ON_GA: GA
jobs:
test:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
# The process
steps:
- name: Set up Python
uses: actions/setup-python@v4
id: cp39
with:
python-version: 3.9
- uses: actions/checkout@v2
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install ffmpeg libsm6 libxext6 -y
sudo apt-get install libportaudio2 libportaudiocpp0 portaudio19-dev libasound-dev libsndfile1-dev portaudio19-dev python3-pyaudio -y
${{ steps.cp39.outputs.python-path }} -m pip install --upgrade pip
${{ steps.cp39.outputs.python-path }} -m pip install '.[test]'
docker build -t chimerapy .
echo "MANUAL_OS_SET=Linux" >> $GITHUB_ENV
- name: Install HomeBrew for MacOS
if: matrix.os == 'macos-latest'
uses: Homebrew/actions/setup-homebrew@master
- name: Install MacOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew install portaudio
${{ steps.cp39.outputs.python-path }} -m pip install --upgrade pip
${{ steps.cp39.outputs.python-path }} -m pip install '.[test]'
echo "MANUAL_OS_SET=Darwin" >> $GITHUB_ENV
- name: Install Windows dependencies
if: matrix.os == 'windows-latest'
run: |
${{ steps.cp39.outputs.python-path }} -m pip install --upgrade pip
${{ steps.cp39.outputs.python-path }} -m pip install .[test]
echo "MANUAL_OS_SET=Windows" >> $GITHUB_ENV
- name: Perform ChimeraPy utils tests
run: |
${{ steps.cp39.outputs.python-path }} -m coverage run --source=chimerapy -m pytest -v --reruns 5 --color yes --reruns-delay 5 -m test/core
${{ steps.cp39.outputs.python-path }} -m coverage combine --append
mv chimerapy-engine-test.log chimerapy-engine-test-utils.log
- name: Perform ChimeraPy logger tests
run: |
${{ steps.cp39.outputs.python-path }} -m coverage run --source=chimerapy -m pytest -v --reruns 5 --color yes --reruns-delay 5 -m test/logger
${{ steps.cp39.outputs.python-path }} -m coverage combine --append
mv chimerapy-engine-test.log chimerapy-engine-test-logger.log
- name: Perform ChimeraPy Node tests
run: |
${{ steps.cp39.outputs.python-path }} -m coverage run --source=chimerapy -m pytest -v --reruns 5 --color yes --reruns-delay 5 -m test/node
${{ steps.cp39.outputs.python-path }} -m coverage combine --append
mv chimerapy-engine-test.log chimerapy-engine-test-node.log
- name: Perform ChimeraPy Worker tests
run: |
${{ steps.cp39.outputs.python-path }} -m coverage run --source=chimerapy -m pytest -v --reruns 5 --color yes --reruns-delay 5 -m test/worker
${{ steps.cp39.outputs.python-path }} -m coverage combine --append
mv chimerapy-engine-test.log chimerapy-engine-test-worker.log
- name: Perform ChimeraPy Manager tests
run: |
${{ steps.cp39.outputs.python-path }} -m coverage run --source=chimerapy -m pytest -v --reruns 5 --color yes --reruns-delay 5 -m test/manager
${{ steps.cp39.outputs.python-path }} -m coverage combine --append
mv chimerapy-engine-test.log chimerapy-engine-test-manager.log
- name: Combine test logs
run : |
cat chimerapy-engine-test-*.log > chimerapy-engine-test.log
- name: Upload test logs as artifact
uses: actions/upload-artifact@v3
with:
name: chimerapy-engine-test-${{ env.MANUAL_OS_SET }}.log
path: chimerapy-engine-test.log
- name: Upload coverage data to coveralls.io
if : matrix.os == 'ubuntu-latest'
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls.io
needs: test
runs-on: ubuntu-latest
container: python:3-slim
if: github.ref == 'refs/heads/main'
steps:
- name: Finished
run: |
${{ steps.cp39.outputs.python-path }} -m pip install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}