Merge pull request #16543 from SimonRichardson/fuzz-wait-for #1947
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: "Smoke" | |
on: | |
push: | |
branches: [2.9, 3.1, 3.2, 3.3, main] | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
smoke: | |
name: Smoke | |
runs-on: [self-hosted, linux, x64, aws, xlarge] | |
if: github.event.pull_request.draft == false | |
strategy: | |
fail-fast: false | |
matrix: | |
cloud: ["localhost", "microk8s"] | |
steps: | |
- name: Install Dependencies | |
shell: bash | |
run: | | |
set -euxo pipefail | |
echo "/snap/bin" >> $GITHUB_PATH | |
sudo DEBIAN_FRONTEND=noninteractive apt install -y expect | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup LXD | |
if: matrix.cloud == 'localhost' | |
uses: canonical/setup-lxd@4e959f8e0d9c5feb27d44c5e4d9a330a782edee0 | |
- name: Setup Docker Mirror | |
shell: bash | |
run: | | |
(cat /etc/docker/daemon.json 2> /dev/null || echo "{}") | yq -o json '.registry-mirrors += ["http://10.0.1.123:80"]' | sudo tee /etc/docker/daemon.json | |
(cat /etc/docker/daemon.json 2> /dev/null || echo "{}") | yq -o json '.insecure-registries += ["10.0.1.123"]' | sudo tee /etc/docker/daemon.json | |
sudo systemctl restart docker | |
docker system info | |
- name: Setup MicroK8s | |
if: matrix.cloud == 'microk8s' | |
uses: balchua/microk8s-actions@e99a1ffcd3bb2682d941104cf6c1a215c657903f | |
with: | |
channel: "1.28-strict/stable" | |
addons: '["dns", "hostpath-storage", "rbac"]' | |
launch-configuration: "$GITHUB_WORKSPACE/.github/microk8s-launch-config-aws.yaml" | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: setup env | |
shell: bash | |
run: | | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Install local Juju | |
shell: bash | |
run: | | |
make go-install | |
- name: Update microk8s operator image | |
if: matrix.cloud == 'microk8s' | |
run: | | |
# TODO: use temporary Docker account (set DOCKER_USERNAME env var) | |
sg snap_microk8s 'make microk8s-operator-update' | |
- name: Smoke test (LXD) | |
if: matrix.cloud == 'localhost' | |
shell: bash | |
run: | | |
cd tests | |
export MODEL_ARCH=$(go env GOARCH) | |
./main.sh -v -s 'test_build' smoke | |
- name: Smoke test (MicroK8s) | |
if: matrix.cloud == 'microk8s' | |
shell: bash | |
run: | | |
cd tests | |
export MODEL_ARCH=$(go env GOARCH) | |
sg snap_microk8s './main.sh -c microk8s -v smoke_k8s' |