Skip to content

Commit

Permalink
Merge branch 'main' into track-charmed-openstack-exporter-snap
Browse files Browse the repository at this point in the history
  • Loading branch information
Deezzir authored Dec 3, 2024
2 parents 51880c1 + 4fbf4ad commit 9fe4ec5
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ templates = {
destination = ".yamllint"
vars = {}
}
tics = {
source = "./templates/github/snap_tics.yaml.tftpl"
destination = ".github/workflows/tics.yaml"
vars = {
project = "charmed-openstack-exporter-snap",
}
}
jira_sync_config = {
source = "./templates/github/jira_sync_config.yaml.tftpl"
destination = ".github/.jira_sync_config.yaml"
Expand Down
7 changes: 7 additions & 0 deletions terraform-plans/configs/dcgm-snap_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ templates = {
destination = ".github/workflows/promote.yaml"
vars = {}
}
tics = {
source = "./templates/github/snap_tics.yaml.tftpl"
destination = ".github/workflows/tics.yaml"
vars = {
project = "dcgm-snap",
}
}
release = {
source = "./templates/github/snap_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
Expand Down
7 changes: 7 additions & 0 deletions terraform-plans/configs/smartctl-exporter-snap_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ templates = {
destination = ".github/workflows/promote.yaml"
vars = {}
}
tics = {
source = "./templates/github/snap_tics.yaml.tftpl"
destination = ".github/workflows/tics.yaml"
vars = {
project = "smartctl-exporter-snap",
}
}
release = {
source = "./templates/github/snap_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/modules/GitHub/settings/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resource "github_repository" "repo" {
allow_auto_merge = false

allow_update_branch = true
delete_branch_on_merge = false
delete_branch_on_merge = true
vulnerability_alerts = true

}
Expand Down
51 changes: 51 additions & 0 deletions terraform-plans/templates/github/snap_tics.yaml.tftpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file is centrally managed as a template file in https://github.com/canonical/solutions-engineering-automation
# To update the file:
# - Edit it in the canonical/solutions-engineering-automation repository.
# - Open a PR with the changes.
# - When the PR merges, the soleng-terraform bot will open a PR to the target repositories with the changes.
name: TICS

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install dependencies
run: |
sudo apt update
python -m pip install --upgrade pip
# tics action requires flake8 to be installed on the runner
# https://github.com/tiobe/tics-github-action/issues/410
python -m pip install flake8
# pin tox to the current major version to avoid
# workflows breaking all at once when a new major version is released.
python -m pip install 'tox<5'

# The snap is built already in the check workflow and available as an artifact,
# but we want this TICS workflow to be independent,
# so we can run the workflow periodically or on demand.
- name: Build the snap
id: build
uses: canonical/action-build@v1

- name: Test with tox and produce coverage report
run: tox -e tics

- name: Run TICS analysis
uses: tiobe/tics-github-action@v3
with:
mode: qserver
project: ${project}
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
branchdir: $${{ github.workspace }}
ticsAuthToken: $${{ secrets.TICSAUTHTOKEN }}
installTics: true

0 comments on commit 9fe4ec5

Please sign in to comment.