Avoid broken macaroonbakery release #53
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.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 | |
strategy: | |
fail-fast: false | |
matrix: | |
juju_channel: | |
- latest/stable | |
- 2.9/stable | |
- 2.8/stable | |
bundle: | |
- first | |
- second | |
- third | |
exclude: | |
# disable 'first' and 'second' bundles for juju 2.8 since 'magpie' | |
# is not a promulgated charm in the charmstore, only on charmhub | |
# which 2.8 can't talk to. | |
- juju_channel: 2.8/stable | |
bundle: first | |
- juju_channel: 2.8/stable | |
bundle: second | |
env: | |
TEST_ZAZA_BUG_LP1987332: "on" # http://pad.lv/1987332 | |
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 --channel ${{ matrix.juju_channel }} --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 | |
# pull images | |
lxc image copy --alias juju/bionic/amd64 --copy-aliases ubuntu-daily:bionic local: | |
lxc image copy --alias juju/focal/amd64 --copy-aliases ubuntu-daily:focal local: | |
lxc image copy --alias juju/jammy/amd64 --copy-aliases ubuntu-daily:jammy local: | |
lxc image list | |
juju bootstrap --no-gui localhost | |
- name: Functional test | |
run: | | |
set -euxo pipefail | |
mkdir logs | |
tox -e func-target -- ${{ matrix.bundle }} | tee logs/tox-output.txt | |
- name: crashdump on failure | |
if: failure() | |
run: | | |
set -eux | |
juju models | |
model=$(juju models --format yaml|grep "^- name:.*zaza"|cut -f2 -d/) | |
juju status -m $model | tee logs/juju-status.txt | |
juju crashdump -m $model -o logs/ | |
- name: upload logs on failure | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-run-logs-and-crashdump | |
path: logs/ |