Prometheus integration via control socket #86
Workflow file for this run
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: "CI" | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "Build" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python3 --version | |
sudo snap install charmcraft --classic | |
- name: Set up LXD | |
uses: canonical/setup-lxd@90d76101915da56a42a562ba766b1a77019242fd | |
- name: Pack charm | |
run: | | |
charmcraft pack -v | |
- name: Upload packed charm as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: charm | |
path: '*.charm' | |
bootstrap: | |
name: "Bootstrap" | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
cloud: ["lxd", "microk8s"] | |
env: | |
LOCAL_CHARM_PATH: ${{ github.workspace }}/controller.charm | |
CHARMHUB_NAME: juju-qa-controller | |
CHARMHUB_CHANNEL: latest/edge/${{ github.run_id }} | |
steps: | |
- name: Download packed charm | |
id: download | |
uses: actions/download-artifact@v3 | |
with: | |
name: charm | |
- name: Rename charm file | |
run: | | |
mv ${{ steps.download.outputs.download-path }}/*.charm \ | |
$LOCAL_CHARM_PATH | |
# Currently the only way to get charms on k8s is via Charmhub. | |
- name: Upload charm to Charmhub | |
if: matrix.cloud == 'microk8s' | |
env: | |
CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_AUTH }} | |
run: | | |
sudo snap install charmcraft --classic | |
charmcraft upload $LOCAL_CHARM_PATH \ | |
--name $CHARMHUB_NAME --release $CHARMHUB_CHANNEL | |
- name: Set up LXD | |
if: matrix.cloud == 'lxd' | |
uses: canonical/setup-lxd@90d76101915da56a42a562ba766b1a77019242fd | |
- name: Set up MicroK8s | |
if: matrix.cloud == 'microk8s' | |
uses: balchua/[email protected] | |
with: | |
channel: "1.25-strict/stable" | |
addons: '["dns", "hostpath-storage"]' | |
- name: Install Juju | |
run: | | |
sudo snap install juju --channel 3.0/stable | |
- name: Bootstrap on LXD | |
if: matrix.cloud == 'lxd' | |
run: | | |
juju bootstrap lxd c \ | |
--controller-charm-path=$LOCAL_CHARM_PATH | |
- name: Bootstrap on MicroK8s | |
if: matrix.cloud == 'microk8s' | |
run: | | |
sg snap_microk8s <<EOF | |
juju bootstrap microk8s c \ | |
--controller-charm-path=$CHARMHUB_NAME \ | |
--controller-charm-channel=$CHARMHUB_CHANNEL | |
EOF | |
- name: Check charm status | |
run: | | |
juju switch controller | |
juju wait-for application controller --timeout 1m | |
juju status | |
# TODO: test integration with dashboard / ha-proxy |