面向机器学习的 CI/CD
Ravi Bhadauria
Machine Learning Engineer
main



将其保存为分支中的 hello_world.py
import datetime
def main():
print("Hello, World!")
# Get the current time and print it
current_time = datetime.datetime.now()
print("Current time:", current_time)
if __name__ == "__main__":
main()
on:
pull_request:
branches: [ "main" ]
steps:
- name: My Action
uses: <org_or_user_name>/<reponame>@<version_number>
with:
action-argument: value
Action 存储库 https://github.com/<org_or_user_name>/<reponame>
使用 with 提供参数
GitHub 市场中的 actions:https://github.com/actions
steps:
- name: Checkout
uses: actions/checkout@v3
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
main 的 pull request 上触发build 作业含三步Checkout 检出存储库Setup Python 配置 Python 环境Run Python script 运行该 Python 文件name: PR
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Run Python script
run: |
echo hello_world.py
python hello_world.py


面向机器学习的 CI/CD