CI test with docker compose

This commit is contained in:
Youe Graillot 2021-10-12 01:07:30 +02:00
parent 0f599ff99c
commit e4eb8924ee
2 changed files with 21 additions and 3 deletions

View file

@ -11,6 +11,15 @@ env:
TEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:test TEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:test
jobs: jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test image
run: docker compose -f docker-compose.test.yml run sut
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -55,6 +64,3 @@ jobs:
- name: Image digest - name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }} run: echo ${{ steps.docker_build.outputs.digest }}
- name: Test image
run: docker run --rm ${{ env.TEST_TAG }}

12
docker-compose.test.yml Normal file
View file

@ -0,0 +1,12 @@
version: "3.9"
services:
ihatemoney:
build: .
ports:
- "8000:8000"
sut:
image: alpine
command: wget --spider ihatemoney:8000
depends_on:
- ihatemoney