|
1 | 1 | --- |
2 | 2 | name: "CI" |
3 | | -concurrency: # Cancel any existing runs of this workflow for this same PR |
| 3 | +concurrency: # Cancel any existing runs of this workflow for this same PR |
4 | 4 | group: "${{ github.workflow }}-${{ github.ref }}" |
5 | 5 | cancel-in-progress: true |
6 | | -<<<<<<< HEAD |
7 | | -on: # yamllint disable |
8 | | -======= |
9 | | -on: # yamllint disable-line rule:truthy rule:comments |
10 | | ->>>>>>> c5f3eb1 (Cookie initialy baked by NetworkToCode Cookie Drift Manager Tool) |
| 6 | +on: # yamllint disable-line rule:truthy rule:comments |
11 | 7 | push: |
12 | 8 | branches: |
13 | 9 | - "main" |
14 | 10 | - "develop" |
15 | | -<<<<<<< HEAD |
16 | | - tags: |
17 | | - - "v*" |
18 | | - pull_request: ~ |
19 | | -jobs: |
20 | | - validate_renovate: |
21 | | - runs-on: "ubuntu-24.04" |
22 | | - steps: |
23 | | - - name: "Check out repository code" |
24 | | - uses: "actions/checkout@v2" |
25 | | - - name: "Validate renovate configuration" |
26 | | - uses: "rinchsan/[email protected]" |
27 | | - with: |
28 | | - pattern: "renovate.json" |
29 | | - black: |
30 | | - runs-on: "ubuntu-24.04" |
31 | | - env: |
32 | | - INVOKE_LOCAL: "True" |
33 | | - steps: |
34 | | - - name: "Check out repository code" |
35 | | - uses: "actions/checkout@v2" |
36 | | - - name: "Setup environment" |
37 | | - uses: "networktocode/gh-action-setup-poetry-environment@v6" |
38 | | - with: |
39 | | - poetry-version: "1.8.5" |
40 | | - - name: "Linting: black" |
41 | | - run: "poetry run invoke black" |
42 | | - bandit: |
43 | | - runs-on: "ubuntu-24.04" |
44 | | - env: |
45 | | - INVOKE_LOCAL: "True" |
46 | | - steps: |
47 | | - - name: "Check out repository code" |
48 | | - uses: "actions/checkout@v2" |
49 | | - - name: "Setup environment" |
50 | | - uses: "networktocode/gh-action-setup-poetry-environment@v6" |
51 | | - with: |
52 | | - poetry-version: "1.8.5" |
53 | | - - name: "Linting: bandit" |
54 | | - run: "poetry run invoke bandit" |
55 | | - needs: |
56 | | - - "black" |
57 | | - pydocstyle: |
58 | | - runs-on: "ubuntu-24.04" |
59 | | - env: |
60 | | - INVOKE_LOCAL: "True" |
61 | | - steps: |
62 | | - - name: "Check out repository code" |
63 | | - uses: "actions/checkout@v2" |
64 | | - - name: "Setup environment" |
65 | | - uses: "networktocode/gh-action-setup-poetry-environment@v6" |
66 | | - with: |
67 | | - poetry-version: "1.8.5" |
68 | | - - name: "Linting: pydocstyle" |
69 | | - run: "poetry run invoke pydocstyle" |
70 | | - needs: |
71 | | - - "black" |
72 | | - flake8: |
73 | | - runs-on: "ubuntu-24.04" |
74 | | - env: |
75 | | - INVOKE_LOCAL: "True" |
76 | | - steps: |
77 | | - - name: "Check out repository code" |
78 | | - uses: "actions/checkout@v2" |
79 | | - - name: "Setup environment" |
80 | | - uses: "networktocode/gh-action-setup-poetry-environment@v6" |
81 | | - with: |
82 | | - poetry-version: "1.8.5" |
83 | | - - name: "Linting: flake8" |
84 | | - run: "poetry run invoke flake8" |
85 | | - needs: |
86 | | - - "black" |
87 | | - mypy: |
88 | | - runs-on: "ubuntu-24.04" |
89 | | - env: |
90 | | - INVOKE_LOCAL: "True" |
91 | | - steps: |
92 | | - - name: "Check out repository code" |
93 | | - uses: "actions/checkout@v2" |
94 | | - - name: "Setup environment" |
95 | | - uses: "networktocode/gh-action-setup-poetry-environment@v6" |
96 | | - with: |
97 | | - poetry-version: "1.8.5" |
98 | | - - name: "Linting: mypy" |
99 | | - run: "poetry run invoke mypy" |
100 | | - needs: |
101 | | - - "black" |
102 | | - yamllint: |
103 | | - runs-on: "ubuntu-24.04" |
104 | | - env: |
105 | | - INVOKE_LOCAL: "True" |
106 | | - steps: |
107 | | - - name: "Check out repository code" |
108 | | - uses: "actions/checkout@v2" |
109 | | - - name: "Setup environment" |
110 | | - uses: "networktocode/gh-action-setup-poetry-environment@v6" |
111 | | - with: |
112 | | - poetry-version: "1.8.5" |
113 | | - - name: "Linting: yamllint" |
114 | | - run: "poetry run invoke yamllint" |
115 | | - needs: |
116 | | - - "black" |
117 | | - build: |
118 | | - runs-on: "ubuntu-24.04" |
119 | | - steps: |
120 | | - - name: "Check out repository code" |
121 | | - uses: "actions/checkout@v2" |
122 | | - - name: "Setup environment" |
123 | | - uses: "networktocode/gh-action-setup-poetry-environment@v6" |
124 | | - with: |
125 | | - poetry-version: "1.8.5" |
126 | | - - name: "Build Container" |
127 | | - run: "poetry run invoke build" |
128 | | - needs: |
129 | | - - "bandit" |
130 | | - - "pydocstyle" |
131 | | - - "flake8" |
132 | | - - "yamllint" |
133 | | - - "mypy" |
134 | | - pylint: |
135 | | - runs-on: "ubuntu-24.04" |
136 | | - steps: |
137 | | - - name: "Check out repository code" |
138 | | - uses: "actions/checkout@v2" |
139 | | - - name: "Setup environment" |
140 | | - uses: "networktocode/gh-action-setup-poetry-environment@v6" |
141 | | - with: |
142 | | - poetry-version: "1.8.5" |
143 | | - - name: "Build Container" |
144 | | - run: "poetry run invoke build" |
145 | | - - name: "Linting: Pylint" |
146 | | - run: "poetry run invoke pylint" |
147 | | - needs: |
148 | | - - "build" |
149 | | - unittest: |
150 | | - strategy: |
151 | | - fail-fast: true |
152 | | - matrix: |
153 | | - python-version: ["3.9", "3.10", "3.11"] |
154 | | - poetry-version: ["1.8.5"] |
155 | | - runs-on: "ubuntu-24.04" |
156 | | - env: |
157 | | - PYTHON_VER: "${{ matrix.python-version }}" |
158 | | - steps: |
159 | | - - name: "Check out repository code" |
160 | | - uses: "actions/checkout@v2" |
161 | | - - name: "Setup environment" |
162 | | - uses: "networktocode/gh-action-setup-poetry-environment@3ea5d3ecf382cdcb0c74d4c0ff0629d95fce63c7" |
163 | | - env: |
164 | | - POETRY_VERSION: 1.8.5 |
165 | | - with: |
166 | | - python-version: "${{ matrix.python-version }}" |
167 | | - poetry-version: "${{ matrix.poetry-version }}" |
168 | | - - name: "Install redis" |
169 | | - run: "sudo apt-get install -y redis" |
170 | | - - name: "Run poetry Install" |
171 | | - run: "poetry install" |
172 | | - - name: "Run Tests" |
173 | | - run: "poetry run invoke pytest --local" |
174 | | - needs: |
175 | | - - "pylint" |
176 | | - publish_gh: |
177 | | - name: "Publish to GitHub" |
178 | | - runs-on: "ubuntu-24.04" |
179 | | - if: "startsWith(github.ref, 'refs/tags/v')" |
180 | | - steps: |
181 | | - - name: "Check out repository code" |
182 | | - uses: "actions/checkout@v2" |
183 | | - - name: "Set up Python" |
184 | | - uses: "actions/setup-python@v2" |
185 | | - with: |
186 | | - python-version: "3.9" |
187 | | - - name: "Install Python Packages" |
188 | | - run: "pip install poetry" |
189 | | - - name: "Set env" |
190 | | - run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV" |
191 | | - - name: "Run Poetry Version" |
192 | | - run: "poetry version $RELEASE_VERSION" |
193 | | - - name: "Run Poetry Build" |
194 | | - run: "poetry build" |
195 | | - - name: "Upload binaries to release" |
196 | | - uses: "svenstaro/upload-release-action@v2" |
197 | | - with: |
198 | | - repo_token: "${{ secrets.NTC_GITHUB_TOKEN }}" |
199 | | - file: "dist/*" |
200 | | - tag: "${{ github.ref }}" |
201 | | - overwrite: true |
202 | | - file_glob: true |
203 | | - needs: |
204 | | - - "unittest" |
205 | | - publish_pypi: |
206 | | - name: "Push Package to PyPI" |
207 | | - runs-on: "ubuntu-24.04" |
208 | | - if: "startsWith(github.ref, 'refs/tags/v')" |
209 | | - steps: |
210 | | - - name: "Check out repository code" |
211 | | - uses: "actions/checkout@v2" |
212 | | - - name: "Set up Python" |
213 | | - uses: "actions/setup-python@v2" |
214 | | - with: |
215 | | - python-version: "3.9" |
216 | | - - name: "Install Python Packages" |
217 | | - run: "pip install poetry" |
218 | | - - name: "Set env" |
219 | | - run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV" |
220 | | - - name: "Run Poetry Version" |
221 | | - run: "poetry version $RELEASE_VERSION" |
222 | | - - name: "Run Poetry Build" |
223 | | - run: "poetry build" |
224 | | - - name: "Push to PyPI" |
225 | | - uses: "pypa/gh-action-pypi-publish@release/v1" |
226 | | - with: |
227 | | - user: "__token__" |
228 | | - password: "${{ secrets.PYPI_API_TOKEN }}" |
229 | | - needs: |
230 | | - - "unittest" |
231 | | - slack-notify: |
232 | | - needs: |
233 | | - - "publish_gh" |
234 | | - - "publish_pypi" |
235 | | - name: "Send notification to the Slack" |
236 | | - runs-on: "ubuntu-24.04" |
237 | | - env: |
238 | | - SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}" |
239 | | - SLACK_MESSAGE: >- |
240 | | - *NOTIFICATION: NEW-RELEASE-PUBLISHED*\n |
241 | | - Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n |
242 | | - Release: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>\n |
243 | | - Published by: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}> |
244 | | - steps: |
245 | | - - name: "Send a notification to Slack" |
246 | | - # ENVs cannot be used directly in job.if. This is a workaround to check |
247 | | - # if SLACK_WEBHOOK_URL is present. |
248 | | - if: "${{ env.SLACK_WEBHOOK_URL != '' }}" |
249 | | - uses: "slackapi/[email protected]" |
250 | | - with: |
251 | | - payload: | |
252 | | - { |
253 | | - "text": "${{ env.SLACK_MESSAGE }}", |
254 | | - "blocks": [ |
255 | | - { |
256 | | - "type": "section", |
257 | | - "text": { |
258 | | - "type": "mrkdwn", |
259 | | - "text": "${{ env.SLACK_MESSAGE }}" |
260 | | - } |
261 | | - } |
262 | | - ] |
263 | | - } |
264 | | - env: |
265 | | - SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}" |
266 | | - SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK" |
267 | | -======= |
268 | 11 | pull_request: ~ |
269 | 12 |
|
270 | 13 | env: |
@@ -362,9 +105,9 @@ jobs: |
362 | 105 | run: "echo INVOKE_DIFFSYNC_IMAGE_VER=`poetry version -s`-py$${{ matrix.python-version }} >> $GITHUB_ENV" |
363 | 106 | - name: "Set up Docker Buildx" |
364 | 107 | id: "buildx" |
365 | | - uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0 |
| 108 | + uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0 |
366 | 109 | - name: "Build" |
367 | | - uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0 |
| 110 | + uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0 |
368 | 111 | with: |
369 | 112 | builder: "${{ steps.buildx.outputs.name }}" |
370 | 113 | context: "./" |
@@ -399,9 +142,9 @@ jobs: |
399 | 142 | run: "echo INVOKE_DIFFSYNC_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV" |
400 | 143 | - name: "Set up Docker Buildx" |
401 | 144 | id: "buildx" |
402 | | - uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0 |
| 145 | + uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0 |
403 | 146 | - name: "Build" |
404 | | - uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0 |
| 147 | + uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0 |
405 | 148 | with: |
406 | 149 | builder: "${{ steps.buildx.outputs.name }}" |
407 | 150 | context: "./" |
@@ -433,4 +176,3 @@ jobs: |
433 | 176 | run: | |
434 | 177 | git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }} |
435 | 178 | poetry run towncrier check --compare-with origin/${{ github.base_ref }} |
436 | | ->>>>>>> c5f3eb1 (Cookie initialy baked by NetworkToCode Cookie Drift Manager Tool) |
0 commit comments