Skip to content

Commit

Permalink
tests now also comes through docker to test it (Liminiens#38)
Browse files Browse the repository at this point in the history
Co-authored-by: Ayrat Hudaygulov <ahudaygulov@microsoft.com>
  • Loading branch information
Szer and Ayrat Hudaygulov authored Dec 10, 2020
1 parent e9c9a98 commit 203763e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/dotnet-test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
name: .NET Core
name: Build & Test

on:
push:
branches: [ master ]
paths-ignore:
- "**.md"
pull_request:
branches: [ master ]
paths-ignore:
- "**.md"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.300
- name: Restore tools
run: dotnet tool restore
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test -c Release --no-restore --verbosity normal
- name: Build & Test
run: docker build .
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bld/
[Bb]in/
[Oo]bj/
[Ll]og/
out/

# Visual Studio 2015 cache/options directory
.vs/
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-dotnet
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build-dotnet
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.sln ./
Expand All @@ -7,16 +7,20 @@ COPY src/Grinder.Common/Grinder.Common.fsproj ./src/Grinder.Common/Grinder.Commo
COPY src/Grinder.DataAccess/Grinder.DataAccess.csproj ./src/Grinder.DataAccess/Grinder.DataAccess.csproj
COPY tests/Grinder.Tests/Grinder.Tests.fsproj ./tests/Grinder.Tests/Grinder.Tests.fsproj
COPY src/Grinder.ExportTool/Grinder.ExportTool.fsproj ./src/Grinder.ExportTool/Grinder.ExportTool.fsproj
RUN dotnet restore
RUN dotnet tool restore
RUN dotnet restore -r linux-x64
# Then build app
COPY src/Grinder/. ./src/Grinder
COPY src/Grinder.Common/. ./src/Grinder.Common
COPY src/Grinder.DataAccess/. ./src/Grinder.DataAccess
WORKDIR /app/src/Grinder
# Build&Test
RUN dotnet test -c Release -r linux-x64 -o out --no-restore --verbosity normal
# Publish
RUN dotnet publish -r linux-x64 -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/core/runtime:3.1
FROM mcr.microsoft.com/dotnet/runtime:3.1

EXPOSE 80

Expand Down

0 comments on commit 203763e

Please sign in to comment.