Skip to content

Commit

Permalink
use test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
DireLines committed Oct 29, 2023
1 parent ab2ead8 commit 177b083
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"hardwareConfig": {
"endpointConfig": {
"gpuIds": "ADA_24,AMPERE_16,AMPERE_24,AMPERE_48,AMPERE_80"
}
},
"input": {
"name": "Dolly"
},
"expectedOutput": "Hello, Dolly!"
},
{
"hardwareConfig": {
"endpointConfig": {
"gpuIds": "ADA_24,AMPERE_16,AMPERE_24,AMPERE_48,AMPERE_80"
}
},
"input": {
"name": "DALL-E"
}
}
]
50 changes: 50 additions & 0 deletions .github/workflows/CD-docker_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Docker Image

on:
push:
branches:
- "main"

jobs:
docker:
runs-on: DO
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:dev
- uses: actions/checkout@v3
- name: Run Tests
id: run-tests
uses: runpod/runpod-test-runner@v1
with:
image-tag: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:dev
runpod-api-key: ${{ secrets.RUNPOD_API_KEY }}
request-timeout: 600

## showing how to consume outputs from test runner for further processing
- name: Verify Tests
env:
TOTAL_TESTS: ${{ steps.run-tests.outputs.total-tests }}
SUCCESSFUL_TESTS: ${{ steps.run-tests.outputs.succeeded }}
RESULTS: ${{ steps.run-tests.outputs.results }}
run: |
echo "Total tests: $TOTAL_TESTS"
echo "Successful tests: $SUCCESSFUL_TESTS"
echo "Full results: $RESULTS"
if [ "$TOTAL_TESTS" != "$SUCCESSFUL_TESTS" ]; then
exit 1
fi

0 comments on commit 177b083

Please sign in to comment.