diff --git a/.github/workflows/terraform-apply.yaml b/.github/workflows/terraform-apply.yaml index dc2410b..d5db9a0 100644 --- a/.github/workflows/terraform-apply.yaml +++ b/.github/workflows/terraform-apply.yaml @@ -1,4 +1,4 @@ -name: Apply new changes to SolEng repositories +name: Run terraform on: workflow_dispatch: diff --git a/terraform-plans/configs/charm-advanced-routing_main.tfvars b/terraform-plans/configs/charm-advanced-routing_main.tfvars index ef266f1..76761c0 100644 --- a/terraform-plans/configs/charm-advanced-routing_main.tfvars +++ b/terraform-plans/configs/charm-advanced-routing_main.tfvars @@ -18,6 +18,7 @@ templates = { vars = { runs_on = "[[ubuntu-22.04]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-apt-mirror_main.tfvars b/terraform-plans/configs/charm-apt-mirror_main.tfvars index 5ba470f..fad96dc 100644 --- a/terraform-plans/configs/charm-apt-mirror_main.tfvars +++ b/terraform-plans/configs/charm-apt-mirror_main.tfvars @@ -18,6 +18,7 @@ templates = { vars = { runs_on = "[[ubuntu-22.04]]", test_commands = "['tox -e func -- -v --series focal', 'tox -e func -- -v --series jammy']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-duplicity_main.tfvars b/terraform-plans/configs/charm-duplicity_main.tfvars index 7089cb8..8a9aacc 100644 --- a/terraform-plans/configs/charm-duplicity_main.tfvars +++ b/terraform-plans/configs/charm-duplicity_main.tfvars @@ -12,6 +12,30 @@ 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']", + juju_channels = "[\"3.4/stable\"]", + } + } + promote = { + source = "./templates/github/charm_promote.yaml.tftpl" + destination = ".github/workflows/promote.yaml" + vars = { + charmcraft_channel = "2.x/stable", + } + } + release = { + source = "./templates/github/charm_release.yaml.tftpl" + destination = ".github/workflows/release.yaml" + vars = { + runs_on = "[[ubuntu-22.04]]", + charmcraft_channel = "2.x/stable", + } + } jira_sync_config = { source = "./templates/github/jira_sync_config.yaml.tftpl" destination = ".github/.jira_sync_config.yaml" diff --git a/terraform-plans/configs/charm-juju-backup-all_main.tfvars b/terraform-plans/configs/charm-juju-backup-all_main.tfvars index e0c4a86..f38c980 100644 --- a/terraform-plans/configs/charm-juju-backup-all_main.tfvars +++ b/terraform-plans/configs/charm-juju-backup-all_main.tfvars @@ -18,6 +18,7 @@ templates = { vars = { runs_on = "[[self-hosted, linux, x64, large, jammy]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-juju-local_main.tfvars b/terraform-plans/configs/charm-juju-local_main.tfvars index 0647e39..ecfd21e 100644 --- a/terraform-plans/configs/charm-juju-local_main.tfvars +++ b/terraform-plans/configs/charm-juju-local_main.tfvars @@ -18,6 +18,7 @@ templates = { vars = { runs_on = "[[ubuntu-22.04]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-local-users_main.tfvars b/terraform-plans/configs/charm-local-users_main.tfvars index 0fa3217..3209e0a 100644 --- a/terraform-plans/configs/charm-local-users_main.tfvars +++ b/terraform-plans/configs/charm-local-users_main.tfvars @@ -23,6 +23,7 @@ templates = { # - runs-on: [self-hosted, jammy, ARM64] runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-logrotated_main.tfvars b/terraform-plans/configs/charm-logrotated_main.tfvars index a1fa5d3..b2165d4 100644 --- a/terraform-plans/configs/charm-logrotated_main.tfvars +++ b/terraform-plans/configs/charm-logrotated_main.tfvars @@ -18,6 +18,7 @@ templates = { vars = { runs_on = "[[ubuntu-22.04]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-nginx_main.tfvars b/terraform-plans/configs/charm-nginx_main.tfvars index 29c85ba..f472407 100644 --- a/terraform-plans/configs/charm-nginx_main.tfvars +++ b/terraform-plans/configs/charm-nginx_main.tfvars @@ -18,6 +18,7 @@ templates = { vars = { runs_on = "[[ubuntu-22.04]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-nrpe_main.tfvars b/terraform-plans/configs/charm-nrpe_main.tfvars index 9d69bb3..9eb2a4a 100644 --- a/terraform-plans/configs/charm-nrpe_main.tfvars +++ b/terraform-plans/configs/charm-nrpe_main.tfvars @@ -23,6 +23,7 @@ templates = { # - runs-on: [self-hosted, jammy, ARM64] runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-prometheus-blackbox-exporter_main.tfvars b/terraform-plans/configs/charm-prometheus-blackbox-exporter_main.tfvars index bab7e7a..e97541e 100644 --- a/terraform-plans/configs/charm-prometheus-blackbox-exporter_main.tfvars +++ b/terraform-plans/configs/charm-prometheus-blackbox-exporter_main.tfvars @@ -12,6 +12,30 @@ 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']", + juju_channels = "[\"3.4/stable\"]", + } + } + promote = { + source = "./templates/github/charm_promote.yaml.tftpl" + destination = ".github/workflows/promote.yaml" + vars = { + charmcraft_channel = "2.x/stable", + } + } + release = { + source = "./templates/github/charm_release.yaml.tftpl" + destination = ".github/workflows/release.yaml" + vars = { + runs_on = "[[ubuntu-22.04]]", + charmcraft_channel = "2.x/stable", + } + } jira_sync_config = { source = "./templates/github/jira_sync_config.yaml.tftpl" destination = ".github/.jira_sync_config.yaml" diff --git a/terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars b/terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars index 89b9866..6a93f3f 100644 --- a/terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars +++ b/terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars @@ -12,6 +12,30 @@ 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 = "['TEST_JUJU3=1 make functional']", + juju_channels = "[\"3.4/stable\", \"3.5/stable\"]", + } + } + promote = { + source = "./templates/github/charm_promote.yaml.tftpl" + destination = ".github/workflows/promote.yaml" + vars = { + charmcraft_channel = "2.x/stable", + } + } + release = { + source = "./templates/github/charm_release.yaml.tftpl" + destination = ".github/workflows/release.yaml" + vars = { + runs_on = "[[ubuntu-22.04]]", + charmcraft_channel = "2.x/stable", + } + } jira_sync_config = { source = "./templates/github/jira_sync_config.yaml.tftpl" destination = ".github/.jira_sync_config.yaml" diff --git a/terraform-plans/configs/charm-prometheus-libvirt-exporter_main.tfvars b/terraform-plans/configs/charm-prometheus-libvirt-exporter_main.tfvars index de94761..ee552a8 100644 --- a/terraform-plans/configs/charm-prometheus-libvirt-exporter_main.tfvars +++ b/terraform-plans/configs/charm-prometheus-libvirt-exporter_main.tfvars @@ -23,6 +23,7 @@ templates = { # - runs-on: [self-hosted, jammy, ARM64] runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-storage-connector_main.tfvars b/terraform-plans/configs/charm-storage-connector_main.tfvars index 1b61b5e..1cf991d 100644 --- a/terraform-plans/configs/charm-storage-connector_main.tfvars +++ b/terraform-plans/configs/charm-storage-connector_main.tfvars @@ -12,6 +12,30 @@ 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 = "['TEST_JUJU3=1 make functional']", + juju_channels = "[\"3.4/stable\"]", + } + } + promote = { + source = "./templates/github/charm_promote.yaml.tftpl" + destination = ".github/workflows/promote.yaml" + vars = { + charmcraft_channel = "2.x/stable", + } + } + release = { + source = "./templates/github/charm_release.yaml.tftpl" + destination = ".github/workflows/release.yaml" + vars = { + runs_on = "[[ubuntu-22.04]]", + charmcraft_channel = "2.x/stable", + } + } jira_sync_config = { source = "./templates/github/jira_sync_config.yaml.tftpl" destination = ".github/.jira_sync_config.yaml" diff --git a/terraform-plans/configs/charm-sysconfig_main.tfvars b/terraform-plans/configs/charm-sysconfig_main.tfvars index 276f54b..4d052eb 100644 --- a/terraform-plans/configs/charm-sysconfig_main.tfvars +++ b/terraform-plans/configs/charm-sysconfig_main.tfvars @@ -20,6 +20,7 @@ templates = { # on arm64 right now. runs_on = "[[self-hosted, jammy, X64, large]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/charm-userdir-ldap_main.tfvars b/terraform-plans/configs/charm-userdir-ldap_main.tfvars index f101b00..2b9318e 100644 --- a/terraform-plans/configs/charm-userdir-ldap_main.tfvars +++ b/terraform-plans/configs/charm-userdir-ldap_main.tfvars @@ -23,6 +23,7 @@ templates = { # - runs-on: [self-hosted, jammy, ARM64] runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]", test_commands = "['tox -e func']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/hardware-observer-operator_main.tfvars b/terraform-plans/configs/hardware-observer-operator_main.tfvars index 0d5d288..9fc2556 100644 --- a/terraform-plans/configs/hardware-observer-operator_main.tfvars +++ b/terraform-plans/configs/hardware-observer-operator_main.tfvars @@ -18,6 +18,7 @@ templates = { vars = { runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]", test_commands = "['tox -e func -- -v --series focal --keep-models', 'tox -e func -- -v --series jammy --keep-models']", + juju_channels = "[\"3.4/stable\"]", } } promote = { diff --git a/terraform-plans/configs/prometheus-juju-backup-all-exporter_main.tfvars b/terraform-plans/configs/prometheus-juju-backup-all-exporter_main.tfvars index cbb102e..22f110c 100644 --- a/terraform-plans/configs/prometheus-juju-backup-all-exporter_main.tfvars +++ b/terraform-plans/configs/prometheus-juju-backup-all-exporter_main.tfvars @@ -12,6 +12,25 @@ templates = { destination = ".github/CODEOWNERS" vars = {} } + check = { + source = "./templates/github/snap_check.yaml.tftpl" + destination = ".github/workflows/check.yaml" + vars = { + runs_on = "[[ubuntu-22.04]]", + } + } + promote = { + source = "./templates/github/snap_promote.yaml.tftpl" + destination = ".github/workflows/promote.yaml" + vars = {} + } + release = { + source = "./templates/github/snap_release.yaml.tftpl" + destination = ".github/workflows/release.yaml" + vars = { + runs_on = "[[ubuntu-22.04]]", + } + } jira_sync_config = { source = "./templates/github/jira_sync_config.yaml.tftpl" destination = ".github/.jira_sync_config.yaml" diff --git a/terraform-plans/configs/prometheus-juju-exporter_main.tfvars b/terraform-plans/configs/prometheus-juju-exporter_main.tfvars index 13be31d..d870beb 100644 --- a/terraform-plans/configs/prometheus-juju-exporter_main.tfvars +++ b/terraform-plans/configs/prometheus-juju-exporter_main.tfvars @@ -12,6 +12,25 @@ templates = { destination = ".github/CODEOWNERS" vars = {} } + check = { + source = "./templates/github/snap_check.yaml.tftpl" + destination = ".github/workflows/check.yaml" + vars = { + runs_on = "[[ubuntu-22.04]]", + } + } + promote = { + source = "./templates/github/snap_promote.yaml.tftpl" + destination = ".github/workflows/promote.yaml" + vars = {} + } + release = { + source = "./templates/github/snap_release.yaml.tftpl" + destination = ".github/workflows/release.yaml" + vars = { + runs_on = "[[ubuntu-22.04]]", + } + } jira_sync_config = { source = "./templates/github/jira_sync_config.yaml.tftpl" destination = ".github/.jira_sync_config.yaml" diff --git a/terraform-plans/templates/github/charm_check.yaml.tftpl b/terraform-plans/templates/github/charm_check.yaml.tftpl index 4441eba..ea1098e 100644 --- a/terraform-plans/templates/github/charm_check.yaml.tftpl +++ b/terraform-plans/templates/github/charm_check.yaml.tftpl @@ -83,8 +83,8 @@ jobs: fail-fast: false matrix: runs-on: ${runs_on} - test-command: ${test_commands} - juju-channel: ["3.4/stable"] + test-command: ${ test_commands } + juju-channel: ${ juju_channels } steps: - uses: actions/checkout@v4 diff --git a/terraform-plans/templates/github/snap_check.yaml.tftpl b/terraform-plans/templates/github/snap_check.yaml.tftpl index 094d634..1f9c46e 100644 --- a/terraform-plans/templates/github/snap_check.yaml.tftpl +++ b/terraform-plans/templates/github/snap_check.yaml.tftpl @@ -90,7 +90,7 @@ jobs: - name: Determine system architecture run: echo "SYSTEM_ARCH=$(uname -m)" >> $GITHUB_ENV - - name: Download the built snap + - name: Download snap file artifact uses: actions/download-artifact@v4 with: name: snap_$${{ env.SYSTEM_ARCH }} @@ -105,5 +105,8 @@ jobs: python -m pip install --upgrade pip python -m pip install 'tox<5' - - name: Run functional tests - run: tox -e func + - name: Run func tests + run: | + export TEST_SNAP="$(pwd)/$(ls | grep '.*_.*\.snap$')" + echo "$TEST_SNAP" + tox -e func