forked from infra/ansible
Enable CI using forgejo actions
Clean the old CI setups and define forgejo actions on ansible repository. Signed-off-by: Michal Konecny <mkonecny@redhat.com>
This commit is contained in:
parent
06d7dd223e
commit
c661866d3c
5 changed files with 39 additions and 28 deletions
33
.forgejo/workflows/ci.yaml
Normal file
33
.forgejo/workflows/ci.yaml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: Linter
|
||||
on: [push, pull-request]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: infra-1
|
||||
steps:
|
||||
- name: Install testing tools
|
||||
run: |
|
||||
sudo dnf install -y yamllint ansible-lint
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
|
||||
- name: Run yamllint
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||
yamllint "$file"
|
||||
done
|
||||
|
||||
- name: Run ansible-lint
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||
ansible-lint "$file"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue