-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#16805 from hmlanigan/merge-from-two-nine
juju#16805 Merge 2.9 into 3.1. * juju#16792 No conflicts
- Loading branch information
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: "Terraform Provider for Juju Smoke" | ||
on: | ||
push: | ||
branches: [2.9, 3.*] | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- '.github/workflows/terraform-smoke.yml' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
smoke: | ||
name: Terraform Smoke | ||
runs-on: [self-hosted, linux, x64, aws, xlarge] | ||
if: github.event.pull_request.draft == false | ||
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 juju | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup LXD | ||
uses: canonical/setup-lxd@4e959f8e0d9c5feb27d44c5e4d9a330a782edee0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
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: Bootstrap Juju - localhost | ||
shell: bash | ||
run: | | ||
set -euxo pipefail | ||
juju bootstrap localhost c \ | ||
--constraints "arch=$(go env GOARCH)" | ||
juju version | ||
- name: Find terraform provider for juju latest release | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'juju/terraform-provider-juju' | ||
#path: terraform-provider-juju | ||
fetch-depth: 0 | ||
|
||
- name: Checkout terraform provider for juju latest release | ||
run: | | ||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
git checkout $LATEST_TAG | ||
- name: Set environment to configure provider for test | ||
run: | | ||
CONTROLLER=$(juju whoami --format yaml | yq .controller) | ||
echo "JUJU_CONTROLLER_ADDRESSES=$(juju show-controller | yq .$CONTROLLER.details.api-endpoints | yq -r '. | join(",")')" >> $GITHUB_ENV | ||
echo "JUJU_USERNAME=$(juju show-controller | yq .$CONTROLLER.account.user)" >> $GITHUB_ENV | ||
echo "JUJU_PASSWORD=$(cat ~/.local/share/juju/accounts.yaml | yq .controllers.$CONTROLLER.password)" >> $GITHUB_ENV | ||
echo "JUJU_CA_CERT<<EOF" >> $GITHUB_ENV | ||
juju show-controller | yq .$CONTROLLER.details.ca-cert >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Run terraform provider for juju ACC tests | ||
shell: bash | ||
env: | ||
TF_ACC: "1" | ||
TEST_CLOUD: lxd | ||
run: | | ||
go mod download | ||
go test -timeout 40m -v -cover ./internal/provider/ |