Pin dependencies for py36 compatibility #76
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
name: Python package | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.6, 3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install codecov tox tox-gh-actions | |
- name: Lint with tox | |
run: tox -e pep8 | |
- name: Test with tox | |
run: tox -e py | |
- name: Codecov | |
run: | | |
set -euxo pipefail | |
codecov --verbose --gcov-glob unit_tests/* | |
func: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: | | |
set -euxo pipefail | |
python -m pip install --upgrade pip | |
pip install tox tox-gh-actions | |
sudo snap install --classic juju | |
sudo snap install --classic juju-crashdump | |
sudo lxd init --auto | |
# This is a throw-away CI environment, do not do this at home | |
sudo chmod 666 /var/snap/lxd/common/lxd/unix.socket | |
# until Juju provides stable IPv6-support we unfortunately need this | |
lxc network set lxdbr0 ipv6.address none | |
juju bootstrap --no-gui localhost | |
- name: Functional test | |
run: | | |
set -euxo pipefail | |
mkdir logs | |
tox -e func | tee logs/tox-output.txt | |
juju status -m $(juju models --format yaml|grep "^- name:.*zaza"|cut -f2 -d/) | tee logs/juju-status.txt | |
- name: crashdump on failure | |
if: failure() | |
run: | | |
set -euxo pipefail | |
juju crashdump -o logs/ | |
- name: upload logs on failure | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-run-logs-and-crashdump | |
path: logs/ |