Skip to content

Commit 4ecc47d

Browse files
author
Sohan Yadav
authored
Merge pull request #5 from clouddrove/CD-344
Update Pre-commit Update GitHub action with pre-commit and ansible lint Remove unwanted (cleanup) This will work With Amazon Linux, Ubuntu, CentOS Updated Redis version with latest 6.2 Add galaxy.yml in actions Add lints in actions Added readme.yml in actions Fix the readme Update the License
2 parents cd03c23 + c3b94cf commit 4ecc47d

File tree

14 files changed

+223
-106
lines changed

14 files changed

+223
-106
lines changed

.github/workflows/galaxy.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Release to Ansible Galaxy
3+
4+
'on':
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-18.04
12+
steps:
13+
- name: galaxy
14+
uses: robertdebock/galaxy-action@1.0.1
15+
with:
16+
galaxy_api_key: ${{ secrets.galaxy_api_key }}

.github/workflows/lint.yml

100755100644
Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ name: Lint
88

99
jobs:
1010

11-
test:
12-
name: Lint
11+
yamllint:
12+
name: yamllint
1313
runs-on: ubuntu-latest
14-
1514
steps:
1615
- name: Check out the codebase.
1716
uses: actions/checkout@v2
@@ -21,21 +20,54 @@ jobs:
2120
with:
2221
python-version: '3.x'
2322

24-
- name: Install test dependencies.
25-
run: pip3 install yamllint ansible-lint
23+
- name: Install yamllist
24+
run: pip3 install yamllint
2625

2726
- name: Run yamllint.
2827
run: yamllint .
2928

29+
ansible-lint:
30+
name: ansible-lint
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout the codebase.
34+
uses: actions/checkout@v2
35+
36+
- name: Set up Python 3.7.
37+
uses: actions/setup-python@v2
38+
with:
39+
python-version: '3.x'
40+
41+
- name: Install ansible and other packages
42+
run: pip3 install ansible ansible-lint
43+
3044
- name: Run ansible-lint.
3145
run: ansible-lint
46+
47+
pre-commit:
48+
name: 'Pre-Commit'
49+
needs:
50+
- yamllint
51+
- ansible-lint
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: 'Checkout'
55+
uses: actions/checkout@v2.3.4
56+
57+
- name: Install ansible-lint
58+
run: pip3 install ansible-lint
59+
60+
- name: 'Pre-Commit 🔎'
61+
uses: pre-commit/action@v2.0.3
62+
continue-on-error: true
63+
3264
- name: 'Slack Notification'
3365
uses: clouddrove/action-slack@v2
3466
with:
3567
status: ${{ job.status }}
3668
fields: repo,author
37-
author_name: 'Clouddrove'
69+
author_name: 'CloudDrove Inc.'
3870
env:
3971
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
72+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ANSIBLE }}
4173
if: always()

.github/workflows/readme.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: 'Create README.md file'
3+
'on':
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
readme-create:
10+
name: 'Autogenerate Readme file'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 'Checkout'
14+
uses: actions/checkout@master
15+
16+
- name: Set up Python 3.7.
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.x'
20+
21+
- name: 'Generate readme.md from readme.yaml'
22+
uses: 'clouddrove/github-actions@v8.0'
23+
with:
24+
actions_subcommand: 'readme'
25+
github_token: '${{ secrets.GITHUB }}'
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Install ansible-lint
30+
run: pip3 install ansible-lint
31+
32+
- name: pre-commit check errors
33+
uses: pre-commit/action@v2.0.0
34+
continue-on-error: true
35+
36+
- name: pre-commit fix errors
37+
uses: pre-commit/action@v2.0.0
38+
continue-on-error: true
39+
40+
- name: 'push readme'
41+
uses: 'clouddrove/github-actions@v8.0'
42+
continue-on-error: true
43+
with:
44+
actions_subcommand: 'push'
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: 'Slack Notification'
49+
uses: clouddrove/action-slack@v2
50+
with:
51+
status: ${{ job.status }}
52+
fields: repo,author
53+
author_name: 'CloudDrove Inc.'
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ANSIBLE }}
57+
if: always()

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
*.iml
44
*.zip
55
molecule
6+
.cache

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
repos:
33

44
- repo: https://github.com/pre-commit/pre-commit-hooks.git
5-
rev: v2.2.3
5+
rev: v3.4.0
66
hooks:
77
- id: end-of-file-fixer
88
- id: trailing-whitespace
@@ -15,7 +15,7 @@ repos:
1515
- id: check-added-large-files
1616

1717
- repo: https://github.com/ansible/ansible-lint.git
18-
rev: v4.1.0
18+
rev: v5.0.8
1919
hooks:
2020
- id: ansible-lint
2121
files: \.(yaml|yml)$

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Cloud Drove
3+
Copyright (c) 2021 Cloud Drove
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export GENIE_PATH ?= $(shell 'pwd')/../../../genie
22

3-
include $(GENIE_PATH)/Makefile
3+
include $(GENIE_PATH)/Makefile

0 commit comments

Comments
 (0)