You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Fail when no environments are matched](#fail-when-no-environments-are-matched)
25
+
-[Disable problem matchers](#disable-problem-matchers)
24
26
-[tox requires](#tox-requires)
25
27
-[Overriding Environments to Run](#overriding-environments-to-run)
26
28
-[Versioning](#versioning)
@@ -300,6 +302,40 @@ deps =
300
302
301
303
See [tox's documentation about factor-conditional settings](https://tox.readthedocs.io/en/latest/config.html#factors-and-factor-conditional-settings) as well.
302
304
305
+
#### Fail when no environments are matched
306
+
By default, tox-gh-actions won't fail the run even if it cannot find environments matching the criteria.
307
+
If you want to fail the run in such a case, you can tune the `fail_on_no_env` option.
308
+
309
+
`tox.ini`:
310
+
```ini
311
+
[tox]
312
+
envlist = py{38,39}
313
+
314
+
[gh-actions]
315
+
python =
316
+
3.8: py38
317
+
3.9: py39
318
+
# tox run using Python 3.10 will fail because tox-gh-actions cannot find an environment contains py310 in the envlist.
319
+
3.10: py310
320
+
fail_on_no_env = True
321
+
```
322
+
323
+
#### Disable problem matchers
324
+
For annotating error messages on GitHub Actions, tox-gh-actions uses [the problem matcher functionality](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md).
325
+
However, there is a case that GitHub Actions reports an error like the following in certain environments.
326
+
327
+
```
328
+
Error: Could not find a part of the path '/usr/local/lib/python3.10/site-packages/tox_gh_actions/matcher.json'.
329
+
```
330
+
331
+
To prevent such errors, you can explicitly disable the problem matcher using the `problem_matcher` option.
332
+
333
+
`tox.ini`:
334
+
```ini
335
+
[gh-actions]
336
+
problem_matcher = False
337
+
```
338
+
303
339
#### tox requires
304
340
If your project uses [tox's `requires` configuration](https://tox.wiki/en/latest/config.html#conf-requires),
305
341
you must add `tox-gh-actions` to the `requires` configuration as well. Otherwise, tox-gh-actions won't be loaded as a tox plugin.
0 commit comments