python - 当项目中任何位置的 python 文件(.py)发生更改时,如何运行 github 操作测试?

标签 python github continuous-integration pytest github-actions

当项目中任何地方的任何 python 文件(.py 文件)发生更改时,如何才能有一个运行 pytest 的 github 操作?该项目包含不同语言的混合,我只想在项目中某处(项目内任何级别的任何目录中)的 python 文件发生更改时运行 pytest。

name: Test Python Tests

on:
  push:
    paths:
      - what to put here???? 

jobs:
  build-and-run:
    steps:
    - uses: actions/checkout@v1
    - name: Update Conda environment with "requirements.yml"
      uses: matthewrmshin/conda-action@v1
      with:
        args: conda env update -f ./requirements.yml
    - name: Run "pytest" with the Conda environment
      uses: matthewrmshin/conda-action@v1
      with:
        args: pytest

最佳答案

on:
 push:
  paths:
  - '**.py'

这应该可以解决问题,请参阅 Filter pattern cheat sheet

关于python - 当项目中任何位置的 python 文件(.py)发生更改时,如何运行 github 操作测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63267007/

相关文章:

python - 持续集成、easy_install 和下载问题

python - 将工作目录设置为笔记本目录

python - 在 C 中打印二维数组

git - 将 Heroku 与 git repo 同步的最佳方式?

git - 连接到 GIT 存储库给出错误对等证书无效

java - 通过jenkings在不同服务器上部署相同jar的两个不同版本

python - 将 Python 脚本的输出链接到 C++ 程序的输入

python - 如何使用 Ctrl+C 杀死子线程?

github - 具有编号标题的 Jekyll 帖子出现 "no implicit conversion of Integer into String"错误

node.js - CircleCI 忽略 circle.yml 中指定的 Node 版本