Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from Rheinwerk/PT-180065494-Use-Github-Actions
Browse files Browse the repository at this point in the history
[#180065494] Add Github CI
  • Loading branch information
eifelmicha authored Oct 28, 2021
2 parents 6ed7101 + f36b73f commit cddb346
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 36 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: CI
on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:

lint:
name: CI for Ansible ${{ matrix.ansible-version }} / ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
# Teste alle Kombinationen, auch wenn 1 Job fehlschlägt
fail-fast: false
matrix:
# Nutze die letzten Patch Versionen
ansible-version: [ '>=2.9, <2.10', '>=2.10, <2.11' ]
os: [ 'ubuntu-18.04', 'ubuntu-20.04' ]
# Python Default Versions: 3.6 in Bionic, 3.8 in Focal
python-version: [ '3.6', '3.8' ]

steps:
- name: Check out the codebase
uses: actions/checkout@v2

# Alternativ könnte man auch pip / setuptools über apt installieren, dies dauert nur ewig lang im Vergleich
# 18.04 braucht dann auch noch Rust aufgrund pip <-> cryptography > 3.4 Abhängigkeit: https://github.com/pyca/cryptography/issues/5771#issuecomment-775016788
# Das können wir uns alles sparen
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Ansible ${{ matrix.ansible-version }}
run: pip3 install 'ansible${{ matrix.ansible-version }}'

# Yamllint ist bereits im Ubuntu Image enthalten: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
- name: Check versions
run: |
ansible --version
yamllint --version
- name: Create ansible.cfg with correct roles_path
run: |
printf '[defaults]\nroles_path=../' >ansible.cfg
- name: Run Checks
run: |
find . -name '*.yml' -print0 | xargs -0 yamllint -c galaxy-yamllint.yaml
cd tests; ansible-playbook test.yml -i inventory --syntax-check
./run_tests.sh
env:
ANSIBLE_FORCE_COLOR: '1'
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Release
on:
push:
tags:
- 'v*'

jobs:

release:
name: Release
runs-on: ubuntu-20.04
steps:
# Ansible ist bereits im Ubuntu Image enthalten, wir brauchen keine spezielle Version für den Galaxy Import: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
- name: Trigger import of Role at Ansible Galaxy
run: |
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo $GITHUB_REPOSITORY | cut -d/ -f1) $(echo $GITHUB_REPOSITORY | cut -d/ -f2)
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This role can be used to install a mitigation for XFS memory allocation
deadlocks. It does _not_ solve the actual cause, but can be used to
mitigate the issue for a limited time.

[![Build Status](https://travis-ci.org/Rheinwerk/ansible-role-xfs_guard.svg?branch=master)](https://travis-ci.org/Rheinwerk/ansible-role-xfs_guard)
[![Build Status](https://github.com/Rheinwerk/ansible-role-xfs_guard/actions/workflows/ci.yml/badge.svg)](https://github.com/Rheinwerk/ansible-role-xfs_guard/actions/workflows/ci.yml)

For more details, see the accompanying blog post on the [codecentric blog](https://blog.codecentric.de/en/2017/04/xfs-possible-memory-allocation-deadlock-kmem_alloc/).

Expand Down

0 comments on commit cddb346

Please sign in to comment.