From f28a3c2f8c9d66c41d37213e12fa5c05a7bf47df Mon Sep 17 00:00:00 2001 From: Sahi Mohamed Francis Gonsangbeu Date: Mon, 1 Jan 2024 17:02:11 +0100 Subject: [PATCH] Add Docker CI workflow and update Makefile --- .github/workflows/ci.yml | 21 --------------------- .github/workflows/docker.yml | 13 +++++++++++++ Makefile | 3 +++ 3 files changed, 16 insertions(+), 21 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 84b4cd0..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: CI - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - - - name: Build the FastAPI Docker image - run: docker build . --file Dockerfile --tag age-detection-api-image - - - name: Run tests - run: docker run age-detection-api-image python -m pytest tests/ diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..1d11882 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,13 @@ +name: Docker CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + make build + make test diff --git a/Makefile b/Makefile index b4c6c52..8f8dfd2 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ stop: clean: stop docker rmi $(IMAGE_NAME) +test: + python -m pytest -v +