Skip to content

Commit

Permalink
Merge pull request #6 from tribe29/devel
Browse files Browse the repository at this point in the history
Prepare Release to Galaxy
  • Loading branch information
lgetwan authored Mar 18, 2022
2 parents 80f110e + 2c4db62 commit dfab405
Show file tree
Hide file tree
Showing 35 changed files with 1,415 additions and 118 deletions.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true
contact_links:
# - name: Security bug report
# url:
# about:
- name: Ansible Code of Conduct
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
about: Be nice to other members of the community.
- name: Talk to our Checkmk community.
url: https://forum.checkmk.com/
about: Join our Checkmk community to aks and answer questions
215 changes: 215 additions & 0 deletions .github/workflows/ansible-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml
# README FIRST
# 1. replace "NAMESPACE" and "COLLECTION_NAME" with the correct name in the env section (e.g. with 'community' and 'mycollection')
# 2. If you don't have unit tests remove that section
# 3. If your collection depends on other collections ensure they are installed, see "Install collection dependencies"
# If you need help please ask in #ansible-community on the Libera.chat IRC network

name: Ansible Tests
on:
workflow_dispatch:
push:
branches:
- main
- devel
paths-ignore:
- 'changelogs/**'
- 'docs/**'
- '**.md'

env:
NAMESPACE: tribe29
COLLECTION_NAME: checkmk

jobs:

###
# Sanity tests (REQUIRED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html

sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
ansible:
# It's important that Sanity is tested against all stable-X.Y branches
# Testing against `devel` may fail as new tests are added.
# - stable-2.9 # Only if your collection supports Ansible 2.9
# - stable-2.10
- stable-2.11
- stable-2.12
- devel
runs-on: ubuntu-latest
steps:

# ansible-test requires the collection to be in a directory in the form
# .../ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}/

- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

- name: Set up Python
uses: actions/setup-python@v2
with:
# it is just required to run that once as "ansible-test sanity" in the docker image
# will run on all python versions it supports.
python-version: 3.8

# Install the head of the given branch (devel, stable-2.10)
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

# run ansible-test sanity inside of Docker.
# The docker container has all the pinned dependencies that are required
# and all python versions ansible supports.
- name: Run sanity tests
run: ansible-test sanity --docker -v --color --coverage
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

# # ansible-test support producing code coverage date
# - name: Generate coverage report
# run: ansible-test coverage xml -v --requirements --group-by command --group-by version
# working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

# # See the reports at https://codecov.io/gh/GITHUBORG/REPONAME
# - uses: codecov/codecov-action@v2
# with:
# fail_ci_if_error: false

###
# Unit tests (OPTIONAL)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html

# units:
# runs-on: ubuntu-latest
# name: Units (Ⓐ${{ matrix.ansible }})
# strategy:
# # As soon as the first unit test fails, cancel the others to free up the CI queue
# fail-fast: true
# matrix:
# ansible:
# # - stable-2.9 # Only if your collection supports Ansible 2.9
# - stable-2.10
# - stable-2.11
# - stable-2.12
# - devel

# steps:
# - name: Check out code
# uses: actions/checkout@v2
# with:
# path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# # it is just required to run that once as "ansible-test units" in the docker image
# # will run on all python versions it supports.
# python-version: 3.8

# - name: Install ansible-base (${{ matrix.ansible }})
# run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

# # OPTIONAL If your unit test requires Python libraries from other collections
# # Install them like this
# - name: Install collection dependencies
# run: ansible-galaxy collection install ansible.netcommon ansible.utils -p .

# # Run the unit tests
# - name: Run unit test
# run: ansible-test units -v --color --docker --coverage
# working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

# # ansible-test support producing code coverage date
# - name: Generate coverage report
# run: ansible-test coverage xml -v --requirements --group-by command --group-by version
# working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

# # See the reports at https://codecov.io/gh/GITHUBORG/REPONAME
# - uses: codecov/codecov-action@v2
# with:
# fail_ci_if_error: false

###
# Integration tests (RECOMMENDED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html


# If the application you are testing is available as a docker container and you want to test
# multiple versions see the following for an example:
# https://github.com/ansible-collections/community.zabbix/tree/master/.github/workflows

integration:
runs-on: ubuntu-latest
name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
strategy:
fail-fast: false
matrix:
ansible:
# - stable-2.9 # Only if your collection supports Ansible 2.9
# - stable-2.10
# - stable-2.11
- stable-2.12
# - devel
python:
# - '2.6'
- '2.7'
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
exclude:
# Because ansible-test doesn't support Python 3.9 for Ansible 2.9
# and Python 3.10 is supported in 2.12 or later.
- ansible: stable-2.9
python: '3.9'
- ansible: stable-2.9
python: '3.10'
- ansible: stable-2.10
python: '3.10'
- ansible: stable-2.11
python: '3.10'


steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

- name: Set up Python
uses: actions/setup-python@v2
with:
# it is just required to run that once as "ansible-test integration" in the docker image
# will run on all python versions it supports.
python-version: 3.8

- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

# OPTIONAL If your integration test requires Python libraries or modules from other collections
# Install them like this
# - name: Install collection dependencies
# run: ansible-galaxy collection install ansible.netcommon -p .

# Run the integration tests
- name: Run integration test
run: ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --docker --coverage
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

# # ansible-test support producing code coverage date
# - name: Generate coverage report
# run: ansible-test coverage xml -v --requirements --group-by command --group-by version
# working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}

# # See the reports at https://codecov.io/gh/GITHUBORG/REPONAME
# - uses: codecov/codecov-action@v2
# with:
# fail_ci_if_error: false
66 changes: 66 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Loading

0 comments on commit dfab405

Please sign in to comment.