Black the tutorial notebook #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 | |