Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the github workflow #814

Merged
merged 32 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
68 changes: 0 additions & 68 deletions .github/workflows/minio-dotnet-linux.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/minio-dotnet-windows.yml

This file was deleted.

201 changes: 201 additions & 0 deletions .github/workflows/minio-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: Minio-dotnet Tests

on:
push:
branches: [ develop, main, master ]
pull_request:
branches: [ develop, master ]

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
Solution_Name: Minio.sln
Test_Project_Path: ./Minio.Tests/Minio.Tests.csproj
Minio_Project_Path: ./Minio/Minio.csproj

jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
configuration: [Release]
dotnet-version: ["7.0.x"]

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

# Install .NET
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

# Cache NuGet packages
- name: Setup .NET Nuget cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-dotnet-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-dotnet-

# Install dependencies
- name: Install dependencies
run: |
dotnet restore ${{ env.Solution_Name }}

# Build
- name: Build
run: dotnet build ${{ env.Solution_Name }} --no-restore --configuration Release

# Create the Nuget
- name: Create the Nuget package
run: dotnet pack ${{ env.Minio_Project_Path }} --no-restore --no-build --configuration Release --output ./artifacts

# Upload the normal artifacts
- name: Upload the build output
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
**/bin/Release/
**/obj/Release/
**/*.csproj
**/*.key
**/*.crt

# Upload the Nuget packages
- name: Upload the Nuget packages output
uses: actions/upload-artifact@v3
with:
name: nuget-packages
path: ./artifacts/*

format-check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

# Install .NET
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"

# Install regitlint
- name: Install tool dependencies
run: |
dotnet tool restore

# Run lint
- name: Run lint
run: |
dotnet regitlint --fail-on-diff

unit_tests:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
configuration: [Release]
dotnet-version: ["7.0.x"]

steps:
# Install .NET
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

# Download the build artifacts
- name: Download the build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: .

# Execute build tests
- name: Build & Unit Test
run: dotnet test ${{ env.Test_Project_Path }} --no-restore --no-build --configuration Release

functional_tests:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
configuration: [Release]
dotnet-version: ["7.0.x"]

steps:
# Install .NET
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

# Download the build artifacts
- name: Download the build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: .

# Execute all functional tests in the solution
- name: Execute Functional Tests Linux
env:
MINT_MODE: full
SERVER_ENDPOINT: localhost:9000
ACCESS_KEY: minio
SECRET_KEY: minio123
ENABLE_HTTPS: 1
ENABLE_KMS: 1
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
MINIO_KMS_SECRET_KEY: my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw=
run: |
wget --quiet -O /tmp/minio https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x /tmp/minio
mkdir -p /tmp/minio-config/certs/
cp Minio.Functional.Tests/certs/* /tmp/minio-config/certs/
sudo cp /tmp/minio-config/certs/public.crt /etc/ssl/certs/
sudo cp /tmp/minio-config/certs/private.key /etc/ssl/private/
/tmp/minio -C /tmp/minio-config server /tmp/fs{1...4} &
dotnet Minio.Functional.Tests/bin/Release/net6.0/Minio.Functional.Tests.dll

push_to_nuget:
needs: [build, unit_tests, functional_tests, format-check]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
# Download the Nuget artifacts
- name: Download the Nuget artifacts
uses: actions/download-artifact@v3
with:
name: nuget-packages
path: ./artifacts

# Install .NET
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"

# Push to NuGet
- name: Push to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
5 changes: 1 addition & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<!--<SymbolPackageFormat>snupkg</SymbolPackageFormat>-->
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols>true</IncludeSymbols>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<EmbedUntrackedSources>true</EmbedUntrackedSources>

<DesignTimeBuild>false</DesignTimeBuild>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild Condition=" '$(IsTestProject)' != 'true'">true</GeneratePackageOnBuild>
<PackageIcon>icon.png</PackageIcon>
Expand Down
4 changes: 2 additions & 2 deletions Minio.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Docs\API.md = Docs\API.md
Directory.Build.props = Directory.Build.props
.config\dotnet-tools.json = .config\dotnet-tools.json
.github\workflows\minio-dotnet-linux.yml = .github\workflows\minio-dotnet-linux.yml
.github\workflows\minio-dotnet-windows.yml = .github\workflows\minio-dotnet-windows.yml
.github\workflows\minio-dotnet.yml = .github\workflows\minio-dotnet.yml
README.md = README.md
EndProjectSection
EndProject
Expand Down Expand Up @@ -48,6 +47,7 @@ Global
{9A754E7C-2D22-4AD7-BF1A-CA731920C8D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A754E7C-2D22-4AD7-BF1A-CA731920C8D4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{9A754E7C-2D22-4AD7-BF1A-CA731920C8D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A754E7C-2D22-4AD7-BF1A-CA731920C8D4}.Release|Any CPU.Build.0 = Release|Any CPU
{BF755F32-5535-4248-8F17-E0C261D1954C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF755F32-5535-4248-8F17-E0C261D1954C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF755F32-5535-4248-8F17-E0C261D1954C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# MinIO Client SDK for .NET [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io)
# MinIO Client SDK for .NET

MinIO Client SDK provides higher level APIs for MinIO and Amazon S3 compatible cloud storage services.For a complete list of APIs and examples, please take a look at the [Dotnet Client API Reference](https://min.io/docs/minio/linux/developers/dotnet/API.html).This document assumes that you have a working VisualStudio development environment.

[![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) [![Github Actions](https://github.com/minio/minio-dotnet/actions/workflows/minio-dotnet.yml/badge.svg)](https://github.com/minio/minio-dotnet/actions) [![Nuget](https://img.shields.io/nuget/dt/Minio?logo=nuget&label=nuget&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMinio)](https://www.nuget.org/packages/Minio/) [![GitHub tag (with filter)](https://img.shields.io/github/v/tag/minio/minio-dotnet?label=latest%20release)](https://github.com/minio/minio-dotnet/releases)

## Install from NuGet
To install [MinIO .NET package](https://www.nuget.org/packages/Minio/), run the following command in Nuget Package Manager Console.

Expand Down