fix: updated base #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | Test Handler | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
launch_runner_worker: | |
runs-on: ubuntu-latest | |
outputs: | |
id: ${{ steps.extract_id.outputs.runpod_job_id }} | |
steps: | |
- name: Deploy Worker | |
uses: fjogeleit/http-request-action@v1 | |
id: deploy | |
with: | |
url: "https://api.runpod.ai/v2/${{ vars.RUNNER_24GB }}/run" | |
method: "POST" | |
customHeaders: '{"Content-Type": "application/json"}' | |
bearerToken: ${{ secrets.RUNPOD_API_KEY }} | |
data: '{"input":{"github_pat": "${{ secrets.GH_PAT }}", "github_org":"${{ vars.GH_ORG }}"}}' | |
- name: Extract Job ID | |
id: extract_id | |
run: | | |
ID=$(echo '${{ steps.deploy.outputs.response }}' | jq -r '.id') | |
echo "::set-output name=runpod_job_id::$ID" | |
run_tests: | |
needs: launch_runner_worker | |
runs-on: runpod | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 & install dependencies | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install Dependencies | |
env: | |
PIP_ROOT_USER_ACTION: "ignore" | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r builder/requirements.txt | |
- name: Execute Tests | |
run: | | |
python src/handler.py --test_input='{"input": {"key": "value"}}' | |
cleanup: | |
if: ${{ always() && !success() }} | |
needs: launch_runner_worker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Terminate and Shutdown Worker | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: "https://api.runpod.ai/v2/${{ vars.RUNNER_24GB }}/cancel/${{ needs.launch_runner_worker.outputs.id }}" | |
method: "POST" | |
customHeaders: '{"Content-Type": "application/json"}' | |
bearerToken: ${{ secrets.RUNPOD_API_KEY }} |