gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 09:15:02 24 4
gpt4 key购买 nike

当项目中任何地方的任何 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 Action 测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63267007/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com