Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 4.0.0 #198

Merged
merged 8 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

skip_list:
- 'var-naming[no-role-prefix]'
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
# SPDX-FileCopyrightText: Jan Vlnas
#
# SPDX-License-Identifier: GPL-2.0-or-later

root = true

[*]
Expand Down
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

Expand Down
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
version: 2
updates:
Expand Down
18 changes: 18 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
unattended_upgrades:
- changed-files:
- any-glob-to-any-file:
- "roles/unattended_upgrades/**"
- "molecule/unattended_upgrades/**"
- ".github/workflows/unattended_upgrades.yml"
zammad:
- changed-files:
- any-glob-to-any-file:
- "roles/zammad/**"
- "molecule/zammad/**"
- ".github/workflows/zammad.yml"
20 changes: 20 additions & 0 deletions .github/workflows/import-galaxy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: "Test importing collection"

on:
pull_request:
push:
branches:
- "main"

jobs:
import-galaxy:
permissions:
contents: "read"
name: "Import collection with Galaxy importer"
uses: "ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main"
30 changes: 30 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: "Pull Request Labeler"

on:
pull_request_target:
types:
- "labeled"
- "unlabeled"
- "opened"
- "edited"
- "synchronize"

jobs:
labeler:
runs-on: "ubuntu-22.04"
permissions:
contents: "read"
pull-requests: "write"
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v4"

- uses: "actions/[email protected]"
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
35 changes: 35 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: "Ansible Lint"

on:
pull_request:
paths:
- 'roles/**'
push:
branches:
- "main"
tags:
- "v*.*.*"
paths:
- 'roles/**'

env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1

jobs:

ansible-lint:
name: "Ansible Lint"
runs-on: "ubuntu-22.04"
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v4"

- name: "Lint code."
uses: "ansible/[email protected]"
8 changes: 7 additions & 1 deletion .github/workflows/prepare-action/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: "Install dependencies and prepare the environment."
description: "Install the necessary dependencies for jobs."
Expand All @@ -9,7 +14,7 @@ runs:
shell: "bash"

- name: "Set up Python 3."
uses: "actions/setup-python@v4"
uses: "actions/setup-python@v5"
id: "setup-python"
with:
python-version: "3.10"
Expand All @@ -18,3 +23,4 @@ runs:
- name: "Install dependencies via pipenv."
run: "pipenv install --dev"
shell: "bash"
working-directory: "ansible_collections/hifis/toolkit"
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: "Release new version on Ansible Galaxy"

on:
release:
types:
- "released"

jobs:

release:
name: "Release new version on Ansible Galaxy"
runs-on: "ubuntu-22.04"
steps:
- name: "checkout"
uses: "actions/checkout@v4"

- name: "Deploy the collection"
uses: "artis3n/[email protected]"
with:
api_key: "${{ secrets.galaxy_api_key }}"
22 changes: 22 additions & 0 deletions .github/workflows/reuse-compliance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: "Check compliance with the RUSE specification"

on:
push:
pull_request:

jobs:
reuse-lint:
name: "REUSE compliance check"
runs-on: "ubuntu-22.04"
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v4"

- name: "REUSE lint"
uses: "fsfe/[email protected]"
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: "CI"
name: "hifis.unattended_upgrades"

on:
pull_request:
paths:
- '.github/workflows/unattended_upgrades.yml'
- 'roles/unattended_upgrades/**'
- 'molecule/unattended_upgrades/**'
- 'Pipfile'
- 'Pipfile.lock'
push:
branches:
- "main"
tags:
- "v*.*.*"
paths:
- '.github/workflows/unattended_upgrades.yml'
- 'roles/unattended_upgrades/**'
- 'molecule/unattended_upgrades/**'
- 'Pipfile'
- 'Pipfile.lock'
schedule:
- cron: '0 0 * * *'

env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1

jobs:

lint:
name: "Lint"
runs-on: "ubuntu-22.04"
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v4"

- name: "Prepare the job environment."
uses: "./.github/workflows/prepare-action"

- name: "Lint code."
run: |
pipenv run yamllint --strict --format colored .
pipenv run ansible-lint -v --force-color --offline

test:
name: "Run Molecule tests."
runs-on: "ubuntu-22.04"
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
strategy:
fail-fast: false
matrix:
Expand All @@ -47,9 +49,11 @@ jobs:
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v4"
with:
path: "ansible_collections/hifis/toolkit"

- name: "Prepare the job environment."
uses: "./.github/workflows/prepare-action"
uses: "./ansible_collections/hifis/toolkit/.github/workflows/prepare-action"

- name: "Install modern podman"
run: |
Expand All @@ -65,20 +69,7 @@ jobs:
sudo apt-get -qq -y install podman

- name: "Run Molecule tests."
run: "pipenv run molecule test"
run: "pipenv run molecule test -s unattended_upgrades"
env:
MOLECULE_IMAGE: "${{ matrix.image }}"

release:
name: "Release new version on Ansible Galaxy"
runs-on: "ubuntu-22.04"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: ["lint", "test"]
steps:
- name: "checkout"
uses: "actions/checkout@v4"
- name: "galaxy"
uses: "robertdebock/[email protected]"
with:
galaxy_api_key: "${{ secrets.galaxy_api_key }}"
git_branch: "main"
working-directory: "ansible_collections/hifis/toolkit"
78 changes: 78 additions & 0 deletions .github/workflows/zammad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: "hifis.zammad"
on:
pull_request:
paths:
- '.github/workflows/zammad.yml'
- 'roles/zammad/**'
- 'molecule/zammad/**'
- 'Pipfile'
- 'Pipfile.lock'
push:
branches:
- "main"
tags:
- "v*.*.*"
paths:
- '.github/workflows/zammad.yml'
- 'roles/zammad/**'
- 'molecule/zammad/**'
- 'Pipfile'
- 'Pipfile.lock'
schedule:
- cron: '0 0 * * *'

jobs:

test:
name: "Run Molecule tests."
runs-on: "ubuntu-22.04"
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
strategy:
fail-fast: false
matrix:
image:
- "ghcr.io/hifis-net/ubuntu-systemd:22.04"
- "ghcr.io/hifis-net/ubuntu-systemd:20.04"

steps:
- name: "Check out the codebase."
uses: "actions/checkout@v4"
with:
path: "ansible_collections/hifis/toolkit"

- name: "Prepare the job environment."
uses: "./ansible_collections/hifis/toolkit/.github/workflows/prepare-action"

# https://github.com/ansible/molecule/issues/3806
- name: "Help molecule to find the dependencies"
run: |
mkdir -p /home/runner/.ansible
ln -s /home/runner/work/ansible-role-unattended-upgrades/ansible-role-unattended-upgrades/ansible_collections/hifis/toolkit/roles \
/home/runner/.ansible/roles

- name: "Install modern podman"
run: |
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt-get update -qq
sudo apt-get -qq -y install podman

- name: "Run Molecule tests."
run: "XDG_RUNTIME_DIR=/run/user/$UID pipenv run molecule test -s zammad"
env:
MOLECULE_IMAGE: "${{ matrix.image }}"
working-directory: "ansible_collections/hifis/toolkit"
Loading