Skip to content

Commit

Permalink
Merge pull request #10 from trfore/v1.1.2-dev
Browse files Browse the repository at this point in the history
ci: add format and lint jobs to workflows
  • Loading branch information
trfore authored May 5, 2024
2 parents 1dc2c36 + 2d259a7 commit 03a91e0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 10 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
name: CI

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

on:
pull_request:
branches:
Expand All @@ -14,11 +9,29 @@ on:
- "step.version"
workflow_dispatch:

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

jobs:
format:
uses: trfore/ansible-role/.github/workflows/format.yml@main

lint:
needs:
- format
uses: trfore/ansible-role/.github/workflows/lint_ansible.yml@main

sanity:
needs:
- format
- lint
uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main

test:
needs:
- format
- lint
- sanity
strategy:
fail-fast: false
Expand All @@ -33,15 +46,20 @@ jobs:
molecule_glob: "./extensions/molecule/*/molecule.yml"
molecule_scenario: ${{ matrix.molecule_scenario }}
requirements_file: "requirements/dev-requirements.txt"

check:
if: ${{ always() && (github.event_name != 'schedule') }}
needs:
- format
- lint
- sanity
- test
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.format.result }}',
'${{ needs.lint.result }}',
'${{ needs.sanity.result }}',
'${{ needs.test.result }}',
]) == {'success'}"
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint
on:
pull_request:
branches: ["main"]
paths:
- "**.md"
- "LICENSE"
push:
branches: ["*"]
paths:
- "**.md"
- "LICENSE"

concurrency:
group: ${{ github.workflow}}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
format:
uses: trfore/ansible-role/.github/workflows/format.yml@main

check:
needs:
- format
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.format.result }}',
]) == {'success'}"
9 changes: 4 additions & 5 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Release Check

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

on:
pull_request:
paths:
- "step.version"

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

jobs:
test:
strategy:
Expand Down

0 comments on commit 03a91e0

Please sign in to comment.