Skip to content

Commit 651b96c

Browse files
committed
switch to GitHub action for Linux CI
1 parent 9850413 commit 651b96c

File tree

4 files changed

+52
-27
lines changed

4 files changed

+52
-27
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: DotNet CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
name: DotNet Test
9+
steps:
10+
- uses: actions/checkout@master
11+
with:
12+
fetch-depth: 0
13+
- name: Fetch tags and master for GitVersion
14+
run: |
15+
git fetch --tags
16+
git branch --create-reflog master origin/master
17+
18+
- name: Setup dotnet
19+
uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: '2.1.607'
22+
- name: Setup dotnet
23+
uses: casz/setup-dotnet@fix/dotnet-global-tool
24+
with:
25+
dotnet-version: '3.1.100'
26+
27+
# workaround for using multiple dotnet core installs
28+
- name: .net SxS
29+
run: rsync -a ${DOTNET_ROOT/3.1.100/2.1.607}/* $DOTNET_ROOT/
30+
31+
- run: dotnet tool install -g Codecov.Tool
32+
shell: pwsh
33+
- run: dotnet build
34+
shell: pwsh
35+
- run: ./test.ps1
36+
shell: pwsh

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

GitLabApiClient.sln

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.29324.140
@@ -10,7 +10,6 @@ EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6E176091-1CD1-475A-AB85-C1735D9422BD}"
1111
ProjectSection(SolutionItems) = preProject
1212
.editorconfig = .editorconfig
13-
.travis.yml = .travis.yml
1413
appveyor.yml = appveyor.yml
1514
build.ps1 = build.ps1
1615
EndProjectSection

test.ps1

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
& dotnet test --filter Category!=LinuxIntegration --settings coverletArgs.runsettings --no-build --no-restore
1+
$dockerOSType = docker info --format "{{.OSType}}"
2+
if ($dockerOSType -ieq 'linux') {
3+
& dotnet test --verbosity normal --settings coverletArgs.runsettings --no-build --no-restore
4+
} else {
5+
& dotnet test --filter Category!=LinuxIntegration --verbosity normal --settings coverletArgs.runsettings --no-build --no-restore
6+
}
7+
8+
$exitWithError = $LastExitCode -ne 0
29

3-
if ($LastExitCode -ne 0)
4-
{
5-
exit 1
10+
$openCoverFile = Get-ChildItem -Path "test/*/coverage.opencover.xml" -Recurse | Sort-Object LastWriteTime | Select-Object -last 1
11+
if (Test-Path "$openCoverFile") {
12+
Write-Host "Uploading coverage file"
13+
& codecov -f "$openCoverFile" -t bda1c835-c4a2-4a1a-8d38-999b9a8ea80b
614
}
715

8-
Write-Host "Uploading coverage file"
9-
$openCoverFile = (Get-ChildItem -Path "test/*/coverage.opencover.xml" -Recurse | Sort-Object LastWriteTime | Select-Object -last 1).FullName
10-
& codecov -f "$openCoverFile" -t bda1c835-c4a2-4a1a-8d38-999b9a8ea80b
16+
if ($exitWithError) {
17+
exit 1
18+
}

0 commit comments

Comments
 (0)