Skip to content

Commit 5149724

Browse files
authored
Merge pull request #81 from sblom/docker
Add Dockerfile to enable local linux testing on Windows
2 parents ff57ebe + 7350960 commit 5149724

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/workflows/docker.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: docker
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ["*"]
7+
pull_request:
8+
branches: [master]
9+
10+
jobs:
11+
docker:
12+
name: build & run tests
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- name: docker build
19+
run: docker build -t json-ld.net .
20+
- name: docker test
21+
run: docker run --rm json-ld.net dotnet test

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# If you want to build and test under Linux using a docker container, here's how:
2+
#
3+
#> docker build -t json-ld.net .
4+
#> docker run --rm json-ld.net dotnet test -v normal
5+
6+
# .NET Core 2.1 on Ubuntu 18.04 LTS
7+
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-bionic
8+
9+
WORKDIR /App
10+
11+
# First we ONLY copy sln and csproj files so that we don't have to re-cache
12+
# dotnet restore every time a .cs file changes
13+
COPY src/json-ld.net/json-ld.net.csproj src/json-ld.net/json-ld.net.csproj
14+
COPY test/json-ld.net.tests/json-ld.net.tests.csproj test/json-ld.net.tests/json-ld.net.tests.csproj
15+
COPY JsonLD.sln JsonLD.sln
16+
RUN dotnet restore
17+
18+
# Then we copy everything and run dotnet build
19+
COPY . .
20+
RUN dotnet build

test/json-ld.net.tests/json-ld.net.tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
88
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
99
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
10+
<RootNamespace>JsonLD.Test</RootNamespace>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

0 commit comments

Comments
 (0)