feat: Builds docker image during tests in ci

This commit is contained in:
2025-01-24 20:33:36 -05:00
parent 2e7865a61c
commit 67e689b51e
2 changed files with 5 additions and 8 deletions

View File

@@ -3,7 +3,7 @@ name: Create and publish a Docker image
# Configures this workflow to run every time a change is pushed to the branch called `release`. # Configures this workflow to run every time a change is pushed to the branch called `release`.
on: on:
push: push:
branches: ['main'] # branches: ['main']
tags: tags:
- '*.*.*' - '*.*.*'
workflow_dispatch: workflow_dispatch:

View File

@@ -1,8 +1,8 @@
docker_image := "purchase_orders" docker_image := "purchase_orders"
docker_tag := "latest" docker_tag := "latest"
build-docker: build-docker file="Dockerfile":
@docker build -t {{docker_image}}:{{docker_tag}} . @docker build -f {{file}} -t {{docker_image}}:{{docker_tag}} .
seed: seed:
swift run App seed swift run App seed
@@ -19,8 +19,5 @@ clean:
bootstrap: bootstrap:
cp ./env.example .env cp ./env.example .env
test-docker: test-docker: (build-docker "dev.Dockerfile")
@docker run --rm \ @docker run --rm {{docker_image}}:{{docker_tag}} swift test
-v "${PWD}:/app" \
-w "/app" "swift:6.0-noble" \
swift test