forked from PyDMD/PyDMD
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (59 loc) · 2.02 KB
/
deploy_after_push.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
## Deploy after push action
name: "CI"
on:
push:
branches:
- master
jobs:
prepare_matrix: ##############################################################################
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setmatrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/[email protected]
- name: Set Dynamic Matrix
id: setmatrix
run: |
matrix_str=$(python utils/info2json.py deploy_matrix)
echo "matrix=$matrix_str" >> $GITHUB_OUTPUT
check_matrix: ##############################################################################
runs-on: ubuntu-latest
needs: prepare_matrix
steps:
- name: Install json2yaml
run: |
sudo npm install -g json2yaml
- name: Check matrix definition
run: |
matrix='${{ needs.prepare_matrix.outputs.matrix }}'
echo $matrix
echo $matrix | jq .
echo $matrix | json2yaml
coverage_deploy: ###########################################################################
needs: prepare_matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJson(needs.prepare_matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: setup.py
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install .[test]
- name: Test with pytest
env:
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
shell: bash
run: |
pytest --cov-report term --cov-report xml:cobertura.xml --cov=pydmd
curl -s https://coverage.codacy.com/get.sh -o CodacyCoverageReporter.sh
chmod +x CodacyCoverageReporter.sh
./CodacyCoverageReporter.sh report -r cobertura.xml -t $CODACY_API_TOKEN