Skip to content

Commit

Permalink
Initial idea for testing upgrades
Browse files Browse the repository at this point in the history
If we use the snap process we can in theory test all the upgrades for a
given PR. This should highlight any potential issues during an upgrade
process.
  • Loading branch information
SimonRichardson committed Sep 23, 2020
1 parent 56b5f51 commit 0b3a1b3
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Upgrade"
on: [push, pull_request]
jobs:
upgrade:
name: linux-amd64
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Install Dependencies
shell: bash
run: |
set -euxo pipefail
sudo apt-get remove lxd lxd-client
sudo snap install snapcraft --classic
sudo snap install lxd
sudo lxd waitready
sudo lxd init --auto
sudo chmod a+wr /var/snap/lxd/common/lxd/unix.socket
echo "##[add-path]/snap/bin"
- name: Bootstrap Juju latest/stable
shell: bash
run: |
set -euxo pipefail
lxc network set lxdbr0 ipv6.address none
sudo snap install juju --classic
juju bootstrap localhost
- name: Checkout
uses: actions/checkout@v2
- name: Build snap
shell: bash
run: |
set -euxo pipefail
snapcraft --use-lxd
- name: Install snap
shell: bash
run: |
set -euxo pipefail
sudo snap install *.snap --dangerous --classic
- name: Test upgrade
shell: bash
run: |
set -euxo pipefail
juju upgrade-controller

0 comments on commit 0b3a1b3

Please sign in to comment.