目前我一直在尝试配置gitlab-ci.yml文件。我在提交时试图自动构建和测试我的python代码。目前,我只是想构建一个简单的hello world程序,并故意通过拼写错误的print(printt而不是print)在python文件中输入错误。当我提交时,管道运行,但它似乎成功通过构建和测试阶段(它不应该)。
任何帮助如何正确配置gitlab-ci.yml文件来自动测试python代码?
我还附上了我当前的gitlab-ci.yml文件。
这很简单。这是我在我的仓库中使用的最小工作示例:
pytest:
image: python:3.6
script:
- apt-get update -q -y
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pytest # or pytest tests/