clearml/examples/cicd/run_clearml_checks.yml
Victor Sonck 51af6e833d
Add CI/CD example (#815)
* Add clearml ci/cd example

* Add section on how to set up CI/CD example
2022-11-08 17:29:49 +02:00

74 lines
2.5 KiB
YAML

name: ClearML Checks
on:
pull_request:
branches: [ main ]
types: [ assigned, opened, edited, reopened, synchronize ]
jobs:
task-stats-to-comment:
env:
CLEARML_API_ACCESS_KEY: ${{ secrets.ACCESS_KEY }}
CLEARML_API_SECRET_KEY: ${{ secrets.SECRET_KEY }}
CLEARML_API_HOST: ${{ secrets.CLEARML_API_HOST }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install ClearML
run: |
python -m pip install --upgrade pip clearml pandas tabulate github3.py Jinja2
- name: Start the task
id: launch_task
run: |
python task_stats_to_comment.py
compare-models:
env:
CLEARML_API_ACCESS_KEY: ${{ secrets.ACCESS_KEY }}
CLEARML_API_SECRET_KEY: ${{ secrets.SECRET_KEY }}
CLEARML_API_HOST: ${{ secrets.CLEARML_API_HOST }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install ClearML
run: |
python -m pip install --upgrade pip clearml pandas tabulate github3.py Jinja2
- name: Start the task
id: launch_task
run: |
python compare_models.py
test-remote-runnable:
env:
CLEARML_API_ACCESS_KEY: ${{ secrets.ACCESS_KEY }}
CLEARML_API_SECRET_KEY: ${{ secrets.SECRET_KEY }}
CLEARML_API_HOST: ${{ secrets.CLEARML_API_HOST }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install ClearML
run: |
python -m pip install --upgrade pip clearml
sudo apt-get update && sudo apt-get install -y ripgrep
- name: Start the task
id: launch_task
run: |
echo "TASK_ID=$(
clearml-task --project 'Github CICD Video' --name cicd_test --branch ${{ github.head_ref }} --script task.py --requirements requirements.txt --skip-task-init --queue default | rg -o 'Task id=(.*) sent' -r '$1'
)" >> $GITHUB_OUTPUT
- name: Poll for task progress
run: python check_clearml_task_running.py "${{ steps.launch_task.outputs.TASK_ID }}"