Skip to content

Commit

Permalink
Use configure_ci tool to scaffold gh workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
GomathiselviS committed May 15, 2024
1 parent a4c0d1c commit ef590db
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 36 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
---
name: changelog and linters
name: Linters

on: [workflow_call] # allow this workflow to be called from other workflows
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
pull_request:

jobs:
linters:
uses: ansible-network/github_actions/.github/workflows/tox.yml@main
with:
envname: ""
labelname: lint
uses: ansible-network/github_actions/.github/workflows/tox-linters.yml@main
ansible-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/[email protected]
8 changes: 0 additions & 8 deletions .github/workflows/sanity.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
---
name: all_green

name: CI

Check failure on line 1 in .github/workflows/tests.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[document-start]

Missing document start "---"
concurrency:
group: ${{ github.head_ref }}
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on: # yamllint disable-line rule:truthy
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- main
- stable-*
tags:
- "*"
workflow_dispatch:

jobs:
linters:
uses: ./.github/workflows/linters.yml # use the callable linters job to run tests
changelog:
uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main
if: github.event_name == 'pull_request'
sanity:
uses: ./.github/workflows/sanity.yml # use the callable sanity job to run tests
uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main
units:
uses: ./.github/workflows/units.yml # use the callable units job to run tests
uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main

all_green:
if: ${{ always() }}
needs:
- linters
- changelog
- sanity
- units
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
python -c "assert 'failure' not in
set([
'${{ needs.linters.result }}',
'${{ needs.changelog.result }}',
'${{ needs.sanity.result }}',
'${{ needs.units.result }}'
]) == {'success'}"
])"
8 changes: 0 additions & 8 deletions .github/workflows/units.yml

This file was deleted.

14 changes: 14 additions & 0 deletions tox-ansible.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[ansible]

skip =
py3.7
py3.8
2.9
2.10
2.11
2.12
2.13
2.14

[testenv:sanity-{py3.10,py3.11,py3.12}-devel]
ignore_outcome = true

0 comments on commit ef590db

Please sign in to comment.