-
-
Notifications
You must be signed in to change notification settings - Fork 59
73 lines (65 loc) · 4.85 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: .NET
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Run Unit Tests
run: |
dotnet --version
dotnet restore
dotnet build
dotnet test --no-build --filter TestCategory!=OPTIONAL-TEST
- name: Run Code Coverage
run: |
dotnet test test/NosCore.Core.Tests/NosCore.Core.Tests.csproj --no-build --filter TestCategory!=OPTIONAL-TEST /p:CollectCoverage=true /p:CoverletOutput="../TestResults/" /p:MergeWith="../TestResults/coverlet.json" /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute='GeneratedCodeAttribute' /p:ExcludeByAttribute='Obsolete' /p:ExcludeByAttribute='CompilerGeneratedAttribute' /p:CoverletOutput='./tools/coverage.opencover.xml'
dotnet test test/NosCore.Database.Tests/NosCore.Database.Tests.csproj --no-build --filter TestCategory!=OPTIONAL-TEST /p:CollectCoverage=true /p:CoverletOutput="../TestResults/" /p:MergeWith="../TestResults/coverlet.json" /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute='GeneratedCodeAttribute' /p:ExcludeByAttribute='Obsolete' /p:ExcludeByAttribute='CompilerGeneratedAttribute' /p:CoverletOutput='./tools/coverage.opencover.xml'
dotnet test test/NosCore.GameObject.Tests/NosCore.GameObject.Tests.csproj --no-build --filter TestCategory!=OPTIONAL-TEST /p:CollectCoverage=true /p:CoverletOutput="../TestResults/" /p:MergeWith="../TestResults/coverlet.json" /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute='GeneratedCodeAttribute' /p:ExcludeByAttribute='Obsolete' /p:ExcludeByAttribute='CompilerGeneratedAttribute' /p:CoverletOutput='./tools/coverage.opencover.xml'
dotnet test test/NosCore.PacketHandlers.Tests/NosCore.PacketHandlers.Tests.csproj --no-build --filter TestCategory!=OPTIONAL-TEST /p:CollectCoverage=true /p:CoverletOutput="../TestResults/" /p:MergeWith="../TestResults/coverlet.json" /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute='GeneratedCodeAttribute' /p:ExcludeByAttribute='Obsolete' /p:ExcludeByAttribute='CompilerGeneratedAttribute' /p:CoverletOutput='./tools/coverage.opencover.xml'
dotnet test test/NosCore.Tests.Shared/NosCore.Tests.Shared.csproj --no-build --filter TestCategory!=OPTIONAL-TEST /p:CollectCoverage=true /p:CoverletOutput="../TestResults/" /p:MergeWith="../TestResults/coverlet.json" /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute='GeneratedCodeAttribute' /p:ExcludeByAttribute='Obsolete' /p:ExcludeByAttribute='CompilerGeneratedAttribute' /p:CoverletOutput='./tools/coverage.opencover.xml'
dotnet test test/NosCore.WebApi.Tests/NosCore.WebApi.Tests.csproj --no-build --filter TestCategory!=OPTIONAL-TEST /p:CollectCoverage=true /p:CoverletOutput="../TestResults/" /p:MergeWith="../TestResults/coverlet.json" /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute='GeneratedCodeAttribute' /p:ExcludeByAttribute='Obsolete' /p:ExcludeByAttribute='CompilerGeneratedAttribute' /p:CoverletOutput='./tools/coverage.opencover.xml'
curl -s https://codecov.io/bash | bash -s -- -t $(CODECOV_TOKEN)
- name: Login to DockerHub
if: github.ref == 'refs/heads/master'
uses: docker/login-action@v1.9.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- run: dotnet test --runtime linux-musl-x64 --filter TestCategory=SomethingAsDotnetBuildDoesntWorkAnymore
- name: Build, tag, and push image LoginServer
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v2
with:
context: .
file: ./deploy/Dockerfile-login
push: true
tags: noscoreio/noscore.loginserver:latest
- name: Build, tag, and push image MasterServer
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v2
with:
context: .
file: ./deploy/Dockerfile-master
push: true
tags: noscoreio/noscore.masterserver:latest
- name: Build, tag, and push image WorldServer
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v2
with:
context: .
file: ./deploy/Dockerfile-world
push: true
tags: noscoreio/noscore.worldserver:latest
#- name: Language Tests
# dotnet test --no-build --filter TestCategory=OPTIONAL-TEST
# aws ecr get-login --region us-west-2 --no-include-email
# aws lambda invoke --function-name noscore-travis --region us-west-2 --payload '{"Build_Id":"'"$TRAVIS_JOB_ID"'", "Travis_Branch":"'"$TRAVIS_BRANCH"'", "Travis_Test_Result":"'"$TRAVIS_TEST_RESULT"'", "Travis_Commit":"'"$TRAVIS_COMMIT"'", "Travis_Repo_Slug":"'"$TRAVIS_REPO_SLUG"'", "Travis_Pull_Request":"'"$TRAVIS_PULL_REQUEST"'"}' outputfile