|
8 | 8 | schedule: |
9 | 9 | - cron: '0 6 * * *' |
10 | 10 |
|
11 | | -env: |
12 | | - COLORTERM: 'yes' |
13 | | - TERM: 'xterm-256color' |
14 | | - PYTEST_ADDOPTS: '--color=yes' |
15 | | - |
16 | 11 | jobs: |
17 | | - linter: |
18 | | - runs-on: ubuntu-latest |
19 | | - strategy: |
20 | | - matrix: |
21 | | - python_version: ["3.11"] |
22 | | - steps: |
23 | | - - name: Check out code |
24 | | - uses: actions/checkout@v3 |
25 | | - with: |
26 | | - path: ansible_collections/middleware_automation/common |
27 | | - |
28 | | - - name: Set up Python ${{ matrix.python_version }} |
29 | | - uses: actions/setup-python@v4 |
30 | | - with: |
31 | | - python-version: ${{ matrix.python_version }} |
32 | | - cache: 'pip' |
33 | | - |
34 | | - - name: Install yamllint, ansible and molecule |
35 | | - run: | |
36 | | - python -m pip install --upgrade pip |
37 | | - pip install yamllint ansible-core ansible-lint |
38 | | - if [ -f ansible_collections/middleware_automation/common/requirements.txt ]; then |
39 | | - pip install -r ansible_collections/middleware_automation/common/requirements.txt |
40 | | - fi |
41 | | - |
42 | | - - name: Create default collection path |
43 | | - run: | |
44 | | - mkdir -p /home/runner/.ansible/ |
45 | | - ln -s /home/runner/work/common/common /home/runner/.ansible/collections |
46 | | -
|
47 | | - - name: Install ansible-lint custom rules |
48 | | - uses: actions/checkout@v3 |
49 | | - with: |
50 | | - repository: ansible-middleware/ansible-lint-custom-rules |
51 | | - path: ansible_collections/ansible-lint-custom-rules/ |
52 | | - |
53 | | - - name: Run linter |
54 | | - run: | |
55 | | - ansible-lint --version |
56 | | - ansible-lint -v |
57 | | - working-directory: ./ansible_collections/middleware_automation/common |
58 | | - |
59 | | - sanity: |
60 | | - uses: ansible-network/github_actions/.github/workflows/sanity.yml@main |
| 12 | + ci: |
| 13 | + uses: ansible-middleware/github-actions/.github/workflows/ci.yml@main |
| 14 | + secrets: |
| 15 | + clientid_prod: '${{ secrets.PROD_JBOSSNETWORK_API_CLIENTID }}' |
| 16 | + clientsecret_prod: '${{ secrets.PROD_JBOSSNETWORK_API_SECRET }}' |
| 17 | + clientid_staging: '${{ secrets.STAGE_JBOSSNETWORK_API_CLIENTID }}' |
| 18 | + clientsecret_staging: '${{ secrets.STAGE_JBOSSNETWORK_API_SECRET }}' |
61 | 19 | with: |
62 | | - matrix_include: "[]" |
63 | | - matrix_exclude: >- |
64 | | - [ |
65 | | - { |
66 | | - "ansible-version": "stable-2.9" |
67 | | - }, |
68 | | - { |
69 | | - "ansible-version": "stable-2.12", |
70 | | - "python-version": "3.7" |
71 | | - }, |
72 | | - { |
73 | | - "ansible-version": "stable-2.12", |
74 | | - "python-version": "3.11" |
75 | | - }, |
76 | | - { |
77 | | - "ansible-version": "stable-2.13", |
78 | | - "python-version": "3.7" |
79 | | - }, |
80 | | - { |
81 | | - "ansible-version": "stable-2.13", |
82 | | - "python-version": "3.11" |
83 | | - }, |
84 | | - { |
85 | | - "ansible-version": "stable-2.14", |
86 | | - "python-version": "3.7" |
87 | | - }, |
88 | | - { |
89 | | - "ansible-version": "stable-2.14", |
90 | | - "python-version": "3.8" |
91 | | - }, |
92 | | - { |
93 | | - "ansible-version": "stable-2.14", |
94 | | - "python-version": "3.11" |
95 | | - }, |
96 | | - { |
97 | | - "ansible-version": "stable-2.15", |
98 | | - "python-version": "3.7" |
99 | | - }, |
100 | | - { |
101 | | - "ansible-version": "stable-2.15", |
102 | | - "python-version": "3.8" |
103 | | - }, |
104 | | - { |
105 | | - "ansible-version": "stable-2.15", |
106 | | - "python-version": "3.11" |
107 | | - }, |
108 | | - { |
109 | | - "ansible-version": "milestone", |
110 | | - "python-version": "3.7" |
111 | | - }, |
112 | | - { |
113 | | - "ansible-version": "milestone", |
114 | | - "python-version": "3.8" |
115 | | - }, |
116 | | - { |
117 | | - "ansible-version": "devel", |
118 | | - "python-version": "3.7" |
119 | | - }, |
120 | | - { |
121 | | - "ansible-version": "devel", |
122 | | - "python-version": "3.8" |
123 | | - }, |
124 | | - { |
125 | | - "ansible-version": "devel", |
126 | | - "python-version": "3.9" |
127 | | - } |
128 | | - ] |
129 | | - molecule: |
130 | | - runs-on: ubuntu-latest |
131 | | - strategy: |
132 | | - matrix: |
133 | | - python_version: ["3.11"] |
134 | | - ansible_version: ["2.14", "2.15"] |
135 | | - molecule_test: |
136 | | - - prod_eap |
137 | | - - stage_eap |
138 | | - steps: |
139 | | - - name: Check out code |
140 | | - uses: actions/checkout@v3 |
141 | | - with: |
142 | | - path: ansible_collections/middleware_automation/common |
143 | | - |
144 | | - - name: Set up Python ${{ matrix.python_version }} |
145 | | - uses: actions/setup-python@v4 |
146 | | - with: |
147 | | - python-version: ${{ matrix.python_version }} |
148 | | - cache: 'pip' |
149 | | - |
150 | | - - name: Create default collection path |
151 | | - run: | |
152 | | - mkdir -p /home/runner/.ansible/ |
153 | | - ln -s /home/runner/work/common/common /home/runner/.ansible/collections |
154 | | -
|
155 | | - - name: Install ansible and molecule |
156 | | - run: | |
157 | | - python -m pip install --upgrade pip |
158 | | - pip install 'molecule>=4.0.4' 'molecule-plugins[docker]>=23.0.0' ansible-core==${{ matrix.ansible_version }} |
159 | | - if [ -f ansible_collections/middleware_automation/common/requirements.txt ]; then |
160 | | - pip install -r ansible_collections/middleware_automation/common/requirements.txt |
161 | | - fi |
162 | | - if [ -f ansible_collections/middleware_automation/common/requirements.yml ]; then |
163 | | - ansible-galaxy collection install -r ansible_collections/middleware_automation/common/requirements.yml -p /home/runner/.ansible/collections --force-with-deps |
164 | | - fi |
165 | | - if [ -f ansible_collections/middleware_automation/common/molecule/requirements.yml ]; then |
166 | | - ansible-galaxy collection install -r ansible_collections/middleware_automation/common/molecule/requirements.yml -p /home/runner/.ansible/collections |
167 | | - fi |
168 | | -
|
169 | | - - name: Run molecule test |
170 | | - run: molecule test -s ${{ matrix.molecule_test }} |
171 | | - working-directory: ./ansible_collections/middleware_automation/common |
172 | | - env: |
173 | | - PY_COLORS: '1' |
174 | | - ANSIBLE_FORCE_COLOR: '1' |
175 | | - PROD_JBOSSNETWORK_API_CLIENTID: '${{ secrets.PROD_JBOSSNETWORK_API_CLIENTID }}' |
176 | | - PROD_JBOSSNETWORK_API_SECRET: '${{ secrets.PROD_JBOSSNETWORK_API_SECRET }}' |
177 | | - STAGE_JBOSSNETWORK_API_CLIENTID: '${{ secrets.STAGE_JBOSSNETWORK_API_CLIENTID }}' |
178 | | - STAGE_JBOSSNETWORK_API_SECRET: '${{ secrets.STAGE_JBOSSNETWORK_API_SECRET }}' |
| 20 | + fqcn: 'middleware_automation/common' |
| 21 | + molecule_tests: >- |
| 22 | + [ "prod_eap", "stage_eap" ] |
0 commit comments