Skip to content

Commit

Permalink
test: add GitHub Action for testing (#11)
Browse files Browse the repository at this point in the history
* add action for testing

* change to run curl in container when testing

* change to use host network in testing

* add sleep 5 seconds to testing
  • Loading branch information
jljl1337 authored Dec 20, 2024
1 parent 79d7984 commit 5c5b019
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Testing

on:
pull_request:
branches:
- main
types:
- opened

jobs:
test:
name: Test the Docker image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build the Docker image
run: docker build -t jljl1337/testpod:test .

- name: Run and test the Docker image
run: |
docker run -d -p 3000:8000 jljl1337/testpod:test
sleep 5
curl http://localhost:3000/
curl http://localhost:3000/api
docker stop $(docker ps -q)

0 comments on commit 5c5b019

Please sign in to comment.