This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Rheinwerk/PT-180065494-Use-Github-Actions
[#180065494] Add Github CI
- Loading branch information
Showing
4 changed files
with
75 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters