bash - 通过 bash 脚本运行 pytest 时使 github 操作失败
问题描述
我们pytest
使用 bash 脚本运行,并且需要基于 pytest 退出代码使 GitHub 操作失败。
GitHub 操作
name: Setup Glue and run unit tests
run: |
chmod +x mycoverage
./mycoverage file_dir
bash 脚本
#!/usr/bin/env bash
coverage run -m pytest "$@"
coverage xml -i
我们可以从中获取退出代码,$?
并且需要知道如何根据$?
bash 脚本中的(非零值)使 GitHub 操作失败。
解决方案
推荐阅读
- c++ - 错误:使用已删除的函数 'ClassName::ClassName(const ClassName&)'
- c++ - 在CGAL中获取两个圆的交点
- ios - 有效登录后React Native iOS“Safari无法打开页面,因为地址无效”
- c# - 如何在 UWP 中通过标题名称数据网格获取列值
- elixir - 如何为 Ecto 迁移中的小数列设置默认值?
- sql - 添加外键约束时出错?
- vue.js - Vuejs:无法解析文件'particles.js'
- angular - 名称为“recaptchaReactive”的表单控件没有值访问器
- javascript - CSS Grid - 向上移动一行的最佳方式?
- r - 正则表达式,根据标点符号 R 分隔?