Skip to content

Commit

Permalink
fix: duplicate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frpouly committed Feb 5, 2024
1 parent e4f4e0b commit c1d7c4e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,30 @@ on:


jobs:
run_tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal

push_to_registry:
needs: build
name: Push Docker image to Docker Hub
needs: run_tests
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v4
Expand All @@ -38,8 +58,8 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./src/Expression/Dockerfile
context: ./src/Expressio
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
Expand Down
6 changes: 3 additions & 3 deletions src/Expressio/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /Expressio
WORKDIR /src/Expressio

# Copy everything
COPY . ./
Expand All @@ -10,8 +10,8 @@ RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /Expressio
COPY --from=build-env /Expressio/out .
WORKDIR /src/Expressio
COPY --from=build-env /src/Expressio/out .

# Expose the port your application will run on
EXPOSE 8080
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ In development environment, a swagger for the API is also accessible through [ht
### Using Docker

```shell
cd src/Expressio
docker build -t expressio -f Dockerfile .
docker build -t expressio -f Dockerfile ./src/Expressio
docker run -d -p 5289:8080 expressio
```

Expand Down

0 comments on commit c1d7c4e

Please sign in to comment.