Skip to content

Commit

Permalink
Add more projects to the automation (#113)
Browse files Browse the repository at this point in the history
* Add more project to the automation

I need to add juju_channels to the configuration and use it in
charm_check template. Add TEST_CHARM env variable to snap_check
template.
Added the check, promote and release for:
 - charm-duplicty
 - charm-promethues-blackbox-exporter
 - charm-prometheus-juju-exporter
 - charm-storage-connector
 - prometheus-backupall-juju-exporter
 - prometheus-juju-exporter

related: #111

Signed-off-by: Robert Gildein <[email protected]>

* Update test commands

charm-duplicity and charm-prometheus-blackbox-exporter
no longer have the legacy makefile,
so we can use tox directly.

* Add missing vars for charm promote template

* Add missing var for charm release templates

* rename workflow

Shorter and easier to read from the Github UI.

* Terraform format

---------

Signed-off-by: Robert Gildein <[email protected]>
Co-authored-by: Samuel Allan <[email protected]>
  • Loading branch information
rgildein and samuelallan72 authored Dec 2, 2024
1 parent d1a54d8 commit f98332f
Show file tree
Hide file tree
Showing 21 changed files with 155 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terraform-apply.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Apply new changes to SolEng repositories
name: Run terraform

on:
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-advanced-routing_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ templates = {
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
juju_channels = "[\"3.4/stable\"]",
}
}
promote = {
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-apt-mirror_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
24 changes: 24 additions & 0 deletions terraform-plans/configs/charm-duplicity_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-juju-backup-all_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-juju-local_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ templates = {
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
juju_channels = "[\"3.4/stable\"]",
}
}
promote = {
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-local-users_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-logrotated_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ templates = {
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
juju_channels = "[\"3.4/stable\"]",
}
}
promote = {
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-nginx_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ templates = {
vars = {
runs_on = "[[ubuntu-22.04]]",
test_commands = "['tox -e func']",
juju_channels = "[\"3.4/stable\"]",
}
}
promote = {
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-nrpe_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 24 additions & 0 deletions terraform-plans/configs/charm-prometheus-juju-exporter_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
24 changes: 24 additions & 0 deletions terraform-plans/configs/charm-storage-connector_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-sysconfig_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions terraform-plans/configs/charm-userdir-ldap_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 19 additions & 0 deletions terraform-plans/configs/prometheus-juju-exporter_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions terraform-plans/templates/github/charm_check.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions terraform-plans/templates/github/snap_check.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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

0 comments on commit f98332f

Please sign in to comment.