Skip to content

Commit

Permalink
Merge branch 'main' into pin-tox-snap
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcocenza authored Sep 20, 2024
2 parents 8f455d7 + 1c6e696 commit 62a3c42
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 13 deletions.
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-advanced-routing_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ templates = {
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['make functional']",
test_commands = "['tox -e func']",
}
}
promote = {
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-apt-mirror_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ templates = {
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['FUNC_ARGS=\"--series focal\" make functional', 'FUNC_ARGS=\"--series jammy\" make functional']",
test_commands = "['tox -e func -- -v --series focal', 'tox -e func -- -v --series jammy']",
}
}
promote = {
Expand Down
20 changes: 20 additions & 0 deletions terraform-plans/configs/charm-juju-backup-all_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,24 @@ templates = {
destination = ".github/CODEOWNERS"
vars = {}
}
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[self-hosted, linux, x64, large, jammy]]",
test_commands = "['tox -e func']",
}
}
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
}
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-juju-local_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ templates = {
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['make functional']",
test_commands = "['tox -e func']",
}
}
promote = {
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-local-users_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ templates = {
# If we have issues with it, we can switch to the larger and more numerous self-hosted options:
# - runs-on: [self-hosted, jammy, ARM64]
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
test_commands = "['make functional']",
test_commands = "['tox -e func']",
}
}
promote = {
Expand Down
20 changes: 20 additions & 0 deletions terraform-plans/configs/charm-logrotated_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,24 @@ templates = {
destination = ".github/CODEOWNERS"
vars = {}
}
check = {
source = "./templates/github/charm_check.yaml.tftpl"
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
}
}
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
}
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-nginx_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ templates = {
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['make functional']",
test_commands = "['tox -e func']",
}
}
promote = {
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-nrpe_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ templates = {
# If we have issues with it, we can switch to the larger and more numerous self-hosted options:
# - runs-on: [self-hosted, jammy, ARM64]
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
test_commands = "['make functional']",
test_commands = "['tox -e func']",
}
}
promote = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ templates = {
# If we have issues with it, we can switch to the larger and more numerous self-hosted options:
# - runs-on: [self-hosted, jammy, ARM64]
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
test_commands = "['make functional']",
test_commands = "['tox -e func']",
}
}
promote = {
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-sysconfig_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ templates = {
# Skip ARM64 check because the functional test runs on lxd VM which is not working
# on arm64 right now.
runs_on = "[[self-hosted, jammy, X64, large]]",
test_commands = "['make functional']",
test_commands = "['tox -e func']",
}
}
promote = {
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/configs/charm-userdir-ldap_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ templates = {
# If we have issues with it, we can switch to the larger and more numerous self-hosted options:
# - runs-on: [self-hosted, jammy, ARM64]
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
test_commands = "['make functional']",
test_commands = "['tox -e func']",
}
}
promote = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ templates = {
destination = ".github/workflows/check.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['FUNC_ARGS=\"--series focal\" make functional', 'FUNC_ARGS=\"--series jammy\" make functional']",
test_commands = "['tox -e func -- -v --series focal', 'tox -e func -- -v --series jammy']",
}
}
promote = {
Expand Down
13 changes: 13 additions & 0 deletions terraform-plans/configs/openstack-exporter-operator_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,17 @@ templates = {
destination = ".github/CODEOWNERS"
vars = {}
}
# check.yaml is not added for now because it has a different format - to use an external juju controller.
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
}
}
}
20 changes: 17 additions & 3 deletions terraform-plans/templates/github/charm_check.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ jobs:
with:
submodules: true

# arm64 runners don't have make or gcc installed by default
# arm64 runners don't have gcc installed by default
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y make gcc
sudo apt install -y gcc

- name: Setup Python
uses: actions/setup-python@v5
Expand All @@ -116,8 +116,22 @@ jobs:
echo "TEST_MODEL_CONSTRAINTS=arch=arm64" >> "$GITHUB_ENV"
fi

- name: Build the charm
run: charmcraft -v pack

- name: Run tests
run: $${{ matrix.test-command }}
run: |
# These variables are for a consistent method to find the charm file(s) across all projects.
# It is designed to work both with charms that output one file per base,
# and charms that output a single file to run on all bases.
# Not all charms will use them, and for some charms the variables will resolve to the same file.
export CHARM_PATH_NOBLE="$(pwd)/$(ls | grep '.*24.04.*\.charm$')"
echo "$CHARM_PATH_NOBLE"
export CHARM_PATH_JAMMY="$(pwd)/$(ls | grep '.*22.04.*\.charm$')"
echo "$CHARM_PATH_JAMMY"
export CHARM_PATH_FOCAL="$(pwd)/$(ls | grep '.*20.04.*\.charm$')"
echo "$CHARM_PATH_FOCAL"
$${{ matrix.test-command }}
env:
TEST_JUJU3: "1" # https://github.com/openstack-charmers/zaza/pull/653
TEST_JUJU_CHANNEL: $${{ matrix.juju-channel }}
Expand Down

0 comments on commit 62a3c42

Please sign in to comment.