Skip to content

Commit 00e9093

Browse files
Merge pull request #1061 from SixLabors/sw/github-actions
enable using github actions for build
2 parents 798d825 + 2e8f50d commit 00e9093

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+335
-1058
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,24 @@
8787
# Set explicit file behavior to:
8888
# treat as binary
8989
###############################################################################
90+
*.basis binary
9091
*.bmp binary
92+
*.dds binary
9193
*.dll binary
9294
*.eot binary
9395
*.exe binary
9496
*.gif binary
9597
*.jpg binary
98+
*.ktx binary
99+
*.pbm binary
96100
*.pdf binary
97101
*.png binary
98102
*.ppt binary
99103
*.pptx binary
104+
*.pvr binary
100105
*.ttf binary
101106
*.snk binary
107+
*.tga binary
102108
*.ttf binary
103109
*.woff binary
104110
*.woff2 binary
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- "v*"
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
Build:
15+
strategy:
16+
matrix:
17+
options:
18+
- os: ubuntu-latest
19+
framework: netcoreapp3.1
20+
runtime: -x64
21+
codecov: false
22+
- os: windows-latest
23+
framework: netcoreapp3.1
24+
runtime: -x64
25+
codecov: true
26+
- os: windows-latest
27+
framework: netcoreapp2.1
28+
runtime: -x64
29+
codecov: false
30+
- os: windows-latest
31+
framework: net472
32+
runtime: -x64
33+
codecov: false
34+
- os: windows-latest
35+
framework: net472
36+
runtime: -x86
37+
codecov: false
38+
39+
runs-on: ${{matrix.options.os}}
40+
41+
steps:
42+
- uses: actions/checkout@v2
43+
44+
- name: Install NuGet
45+
uses: NuGet/setup-nuget@v1
46+
47+
- name: Setup Git
48+
shell: bash
49+
run: |
50+
git config --global core.autocrlf false
51+
git config --global core.longpaths true
52+
git fetch --prune --unshallow
53+
git submodule -q update --init --recursive
54+
55+
- name: Fetch Tags for GitVersion
56+
run: |
57+
git fetch --tags
58+
59+
- name: Fetch master for GitVersion
60+
if: github.ref != 'refs/heads/master'
61+
run: git branch --create-reflog master origin/master
62+
63+
- name: Install GitVersion
64+
uses: gittools/actions/setup-gitversion@v0.3
65+
with:
66+
versionSpec: "5.1.x"
67+
68+
- name: Use GitVersion
69+
id: gitversion # step id used as reference for output values
70+
uses: gittools/actions/execute-gitversion@v0.3
71+
72+
- name: Setup DotNet SDK
73+
uses: actions/setup-dotnet@v1
74+
with:
75+
dotnet-version: "3.1.101"
76+
77+
- name: Build
78+
shell: pwsh
79+
run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}" "${{matrix.options.framework}}"
80+
81+
- name: Test
82+
shell: pwsh
83+
run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}"
84+
env:
85+
CI : True
86+
XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit
87+
88+
- name: Update Codecov
89+
uses: iansu/codecov-action-node@v1.0.0
90+
if: matrix.options.codecov == true
91+
with:
92+
token: ${{secrets.CODECOV_TOKEN}}
93+
file: "coverage.${{matrix.options.framework}}.xml"
94+
flags: unittests
95+
96+
- name: Pack # We can use this filter as we know it happens only once and takes the most time to complete.
97+
if: (github.event_name == 'push') && (matrix.options.codecov == true)
98+
shell: pwsh
99+
run: ./ci-build.ps1 "${{steps.gitversion.outputs.nuGetVersion}}"
100+
101+
- name: Publish to MyGet
102+
if: (github.event_name == 'push') && (matrix.options.codecov == true)
103+
shell: pwsh
104+
run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
105+
# TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ publish/
137137
# Publish Web Output
138138
*.[Pp]ublish.xml
139139
*.azurePubxml
140-
# TODO: Comment the next line if you want to checkin your web deploy settings
140+
# TODO: Comment the next line if you want to checkin your web deploy settings
141141
# but database connection strings (with potential passwords) will be unencrypted
142142
*.pubxml
143143
*.publishproj

.travis.yml

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

.vscode/launch.json

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

.vscode/tasks.json

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

CodeCoverage.runsettings

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

Directory.Build.props

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PropertyGroup>
1515
<BaseArtifactsPath>$(MSBuildThisFileDirectory)artifacts/</BaseArtifactsPath>
1616
<BaseArtifactsPathSuffix>$(ImageSharpProjectCategory)/$(MSBuildProjectName)</BaseArtifactsPathSuffix>
17-
<RepositoryUrl>https://github.com/SixLabors/ImageSharp/</RepositoryUrl>
17+
<RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/SixLabors/ImageSharp/</RepositoryUrl>
1818
</PropertyGroup>
1919

2020
<!-- Default settings that explicitly differ from the Sdk.props defaults -->
@@ -31,43 +31,36 @@
3131

3232
<!--
3333
https://apisof.net/
34-
+===================+================+===================+==============================+======================+==========================+
35-
| Target Framework | SUPPORTS_MATHF | SUPPORTS_HASHCODE | SUPPORTS_EXTENDED_INTRINSICS | SUPPORTS_SPAN_STREAM | SUPPORTS_ENCODING_STRING |
36-
+===================+================+===================+==============================+======================+==========================+
37-
| netcoreapp3.1 | Y | Y | Y | Y | Y |
38-
| netcoreapp2.1 | Y | Y | Y | Y | Y |
39-
| netcoreapp2.0 | Y | N | N | N | N |
40-
| netstandard2.1 | Y | N | N | Y | Y |
41-
| netstandard2.0 | N | N | N | N | N |
42-
| netstandard1.3 | N | N | N | N | N |
43-
| net472 | N | N | Y | N | N |
44-
+===================+================+===================+==============================+======================+==========================+
34+
+===================+=======+==========+=====================+=============+=================+====================+==============+
35+
| SUPPORTS | MATHF | HASHCODE | EXTENDED_INTRINSICS | SPAN_STREAM | ENCODING_STRING | RUNTIME_INTRINSICS | CODECOVERAGE |
36+
+===================+=======+==========+=====================+=============+=================+====================+==============+
37+
| netcoreapp3.1 | Y | Y | Y | Y | Y | Y | Y |
38+
| netcoreapp2.1 | Y | Y | Y | Y | Y | N | Y |
39+
| netcoreapp2.0 | Y | N | N | N | N | N | Y |
40+
| netstandard2.1 | Y | Y | N | Y | Y | N | Y |
41+
| netstandard2.0 | N | N | N | N | N | N | Y |
42+
| netstandard1.3 | N | N | N | N | N | N | N |
43+
| net472 | N | N | Y | N | N | N | Y |
44+
+===================+=======+==========+=====================+=============+=================+====================+==============+
4545
-->
4646

47-
<!-- TODO: Include additional targets to TargetFrameworks -->
48-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1'">
49-
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants>
47+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
48+
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS;SUPPORTS_CODECOVERAGE</DefineConstants>
5049
</PropertyGroup>
51-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
52-
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants>
50+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
51+
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
5352
</PropertyGroup>
54-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0'">
55-
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;</DefineConstants>
53+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
54+
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_CODECOVERAGE</DefineConstants>
5655
</PropertyGroup>
57-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
58-
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants>
56+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
57+
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
5958
</PropertyGroup>
60-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net472'">
61-
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
59+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
60+
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
6261
</PropertyGroup>
63-
64-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
65-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
66-
</PropertyGroup>
67-
68-
<!--TODO: Check what this is testing for and why does it fail?-->
69-
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
70-
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
62+
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
63+
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_CODECOVERAGE</DefineConstants>
7164
</PropertyGroup>
7265

7366
<!-- Default settings that explicitly differ from the Sdk.targets defaults-->
@@ -88,10 +81,10 @@
8881
<Copyright>Copyright © Six Labors and Contributors</Copyright>
8982
<Features>strict;IOperation</Features>
9083
<HighEntropyVA>true</HighEntropyVA>
91-
<LangVersion>7.3</LangVersion>
84+
<LangVersion>8.0</LangVersion>
9285
<NeutralLanguage>en</NeutralLanguage>
9386
<OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
94-
<PackageIconUrl>https://raw.githubusercontent.com/SixLabors/Branding/master/icons/imagesharp/sixlabors.imagesharp.128.png</PackageIconUrl>
87+
<PackageIcon>icon.png</PackageIcon>
9588
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
9689
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
9790
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
@@ -105,9 +98,15 @@
10598
<UseSharedCompilation>true</UseSharedCompilation>
10699
</PropertyGroup>
107100

108-
<!-- Package references which are consumed by all projects -->
101+
<!-- Package references and additional files which are consumed by all projects -->
109102
<ItemGroup>
110103
<PackageReference Include="Microsoft.Net.Compilers.Toolset" IsImplicitlyDefined="true" />
104+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" IsImplicitlyDefined="true" />
105+
<!--TODO: Enable this once tests Stylecop issues are fixed-->
106+
<!--<PackageReference Include="StyleCop.Analyzers" IsImplicitlyDefined="true" />-->
107+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)shared-infrastructure\stylecop.json" />
108+
<!--NuGet package icon source-->
109+
<None Include="$(MSBuildThisFileDirectory)shared-infrastructure\branding\icons\imagesharp\sixlabors.imagesharp.128.png" Pack="true" PackagePath="\icon.png" />
111110
</ItemGroup>
112111

113112
</Project>

0 commit comments

Comments
 (0)