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

Commit

Permalink
Merge branch 'master' into feature/update_jenkins_2.346.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-richter committed Aug 9, 2022
2 parents 628ba31 + 73df2af commit 22dff10
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 73 deletions.
8 changes: 6 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
exclude_paths:
- ./tests/requirements
- .github

skip_list:
- yaml
warn_list:
- experimental # all rules tagged as experimental
- fqcn-builtins # Use FQCN for builtin actions.
- yaml # Violations reported by yamllint.
89 changes: 21 additions & 68 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,45 @@
---
name: CI

env:
ROLE_NAME: wcm_io_devops.jenkins_pipeline_library

defaults:
run:
working-directory: 'wcm_io_devops.jenkins_pipeline_library'

'on':
pull_request:
on:
push:
branches:
- master
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

lint:
name: "Lint (${{ matrix.NAME }})"
name: "lint & syntax check"
runs-on: ubuntu-latest
strategy:
matrix:
include:
- NAME: min_ansible_version
ANSIBLE_VERSION: "==2.7.*"
ANSIBLE_LINT_VERSION: "==4.2.*"
- NAME: latest
ANSIBLE_VERSION: ""
ANSIBLE_LINT_VERSION: ""

steps:
- name: Check out the codebase.
- name: Checkout
uses: actions/checkout@v2
with:
path: '${{ env.ROLE_NAME }}'

- name: Cache PIP
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.ANSIBLE_VERSION }}-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.ANSIBLE_VERSION }}-
- name: Create ansible.cfg
run: "printf '[defaults]\nroles_path=./tests/requirements/:../' > ansible.cfg"
${{ runner.os }}-pip-
- name: Set up Python 3.
uses: actions/setup-python@v2
- name: Install role requirements
uses: BSFishy/pip-action@v1
with:
python-version: '3.9.x'
requirements: "requirements.txt"

- name: Install pip tools.
run: |
pip3 install wheel --upgrade
- name: Install test dependencies.
run: >
pip3 install yamllint
ansible${{ matrix.ANSIBLE_VERSION }}
ansible-lint${{ matrix.ANSIBLE_LINT_VERSION }}
--upgrade
- name: Install role requirements.
run: |
pip3 install -r requirements.txt
- name: Install Galaxy requirements.
run: |
ansible-galaxy install -r tests/requirements.yml -p ./tests/requirements
- name: Lint code.
run: |
yamllint .
ansible-lint
- name: Create ansible.cfg
run: "printf '[defaults]\nroles_path=./tests/requirements/:../' > ansible.cfg"

- name: Test syntax.
run: |
ansible-playbook tests/test.yml -i tests/inventory --syntax-check
- name: ansible-lint
uses: ansible-community/[email protected]

galaxy:
name: "Ansible Galaxy import"
needs:
- lint
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Trigger a new import on Galaxy.
uses: robertdebock/galaxy-action@affc5472cd0b08f64a51eafba49b08898c1bbeb8
- name: ansible-playbook syntax check
uses: dawidd6/[email protected]
with:
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
playbook: tests/test.yml
directory: "."
requirements: tests/requirements.yml
options: --syntax-check -i tests/inventory
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Trigger a new import on Galaxy.
uses: robertdebock/galaxy-action@affc5472cd0b08f64a51eafba49b08898c1bbeb8
uses: robertdebock/galaxy-action@1.2.1
with:
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- name: test role syntax
hosts: test
roles:
- wcm_io_devops.jenkins_pipeline_library
- ansible-jenkins-pipeline-library

0 comments on commit 22dff10

Please sign in to comment.