Skip to content

Commit

Permalink
[GHA] Update reference for GitHub actions (ansible-collections#619)
Browse files Browse the repository at this point in the history
* [GHA] Update reference for GitHub actions

* fix name

* fix test-req

* update test req

* fix tests

* on main only
  • Loading branch information
KB-perByte authored Jan 31, 2024
1 parent 257b77e commit 0005f92
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 59 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ack.yml → .github/workflows/check_label.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
---
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml
name: ack

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

on: # yamllint disable-line rule:truthy
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

jobs:
ack:
uses: ansible/devtools/.github/workflows/ack.yml@main
check_label:
uses: ansible/ansible-content-actions/.github/workflows/check_label.yaml@main
1 change: 1 addition & 0 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: code_coverage

on: # yamllint disable-line rule:truthy
push:
branches: [ main ]
pull_request:
branches: [ main ]

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/draft_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: "Draft release"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
workflow_dispatch:
env:
NAMESPACE: ${{ github.repository_owner }}
COLLECTION_NAME: netcommon
ANSIBLE_COLLECTIONS_PATHS: ./
jobs:
update_release_draft:
uses: ansible/ansible-content-actions/.github/workflows/draft_release.yaml@main
with:
repo: ${{ github.event.pull_request.head.repo.full_name }}
secrets:
BOT_PAT: ${{ secrets.BOT_PAT }}
14 changes: 0 additions & 14 deletions .github/workflows/lint.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/push.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: release
name: "Release collection"
on: # yamllint disable-line rule:truthy
release:
types: [published]

jobs:
release:
uses: ansible/devtools/.github/workflows/release_collection.yml@main
uses: ansible/ansible-content-actions/.github/workflows/release.yaml@main
with:
environment: release
secrets:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: CI
name: "CI"

concurrency:
group: ${{ github.head_ref || github.run_id }}
Expand All @@ -14,12 +14,14 @@ on: # yamllint disable-line rule:truthy

jobs:
changelog:
uses: ansible-network/github_actions/.github/workflows/changelog.yml@main
uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main
if: github.event_name == 'pull_request'
ansible-lint:
uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main
sanity:
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main
unit-galaxy:
uses: ansible-network/github_actions/.github/workflows/unit_galaxy.yml@main
uses: ansible/ansible-content-actions/.github/workflows/unit.yaml@main
unit-source:
uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main
with:
Expand All @@ -30,6 +32,7 @@ jobs:
needs:
- changelog
- sanity
- ansible-lint
- unit-galaxy
- unit-source
runs-on: ubuntu-latest
Expand All @@ -40,5 +43,6 @@ jobs:
'${{ needs.changelog.result }}',
'${{ needs.sanity.result }}',
'${{ needs.unit-galaxy.result }}',
'${{ needs.unit-source.result }}'
'${{ needs.unit-source.result }}',
'${{ needs.ansible-lint.result }}'
])"
2 changes: 1 addition & 1 deletion .github/workflows/token_refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy

jobs:
refresh:
uses: ansible/devtools/.github/workflows/ah_token_refresh.yml@main
uses: ansible/ansible-content-actions/.github/workflows/refresh_ah_token.yaml@main
with:
environment: release
secrets:
Expand Down
7 changes: 4 additions & 3 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# For ansible-tox-linters
black==23.3.0 ; python_version > '3.7'
black==23.3.0
flake8
yamllint

# Unit test runner
pytest-ansible ; python_version >= '3.7'
git+https://github.com/ansible-community/pytest-ansible-units.git ; python_version < '3.7'
pytest-ansible
pytest-xdist
pytest-cov

# The following are 3rd party libs for cli_parse
ntc_templates
# 21.4 changed the output of an error message we check in tests
pyats >= 21.4 ; python_version < '3.11'
genie >= 21.4 ; python_version < '3.11'
passlib
9 changes: 9 additions & 0 deletions tox-ansible.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ansible]
skip =
py3.7
py3.8
2.9
2.10
2.11
2.12
2.13

0 comments on commit 0005f92

Please sign in to comment.