Browse Source

Rework the github workflow (#814)

pull/818/head
Martijn van Dijk 2 years ago
committed by GitHub
parent
commit
f30c7215eb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      .DS_Store
  2. 11
      .github/dependabot.yml
  3. 68
      .github/workflows/minio-dotnet-linux.yml
  4. 55
      .github/workflows/minio-dotnet-windows.yml
  5. 201
      .github/workflows/minio-dotnet.yml
  6. 5
      Directory.Build.props
  7. 4
      Minio.sln
  8. 4
      README.md

BIN
.DS_Store

11
.github/dependabot.yml

@ -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
.github/workflows/minio-dotnet-linux.yml

@ -1,68 +0,0 @@
name: Minio-dotnet Linux Tests
on:
pull_request:
branches:
- 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
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["6.0.x", "7.0.x"]
steps:
- name: Checkout
uses: actions/checkout@v3
# Install the .NET
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies
run: |
dotnet clean --configuration Release
dotnet restore
- name: Install tool dependencies and lint
run: |
dotnet tool restore
dotnet regitlint --fail-on-diff
# Build and Execute build tests
- name: Build & Unit Test
run: |
dotnet build --configuration Release --no-restore
dotnet pack ./Minio/Minio.csproj --no-build --configuration Release --output ./artifacts
dotnet test ./Minio.Tests/Minio.Tests.csproj
# Execute all functional tests in the solution
- name: Execute Functional Tests
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 build Minio.Functional.Tests --configuration Release
dotnet Minio.Functional.Tests/bin/Release/net6.0/Minio.Functional.Tests.dll

55
.github/workflows/minio-dotnet-windows.yml

@ -1,55 +0,0 @@
name: Minio-dotnet Windows Tests
on:
pull_request:
branches:
- 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
jobs:
build:
strategy:
matrix:
configuration: [Release]
dotnet-version: ["6.0.x", "7.0.x"]
runs-on: windows-latest
env:
Solution_Name: Minio.sln
Test_Project_Path: ./Minio.Tests/Minio.Tests.csproj
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install the .NET
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
# Install dependencies
- name: Install dependencies
run: |
dotnet clean ./Minio.sln --configuration Release && dotnet nuget locals all --clear
dotnet restore
# Build and Execute build tests
- name: Build & Unit Test
run: |
dotnet build --configuration Release --no-restore
dotnet pack ./Minio/Minio.csproj --no-build --configuration Release --output ./artifacts
dotnet test ./Minio.Tests/Minio.Tests.csproj
# Execute all functional tests in the solution
- name: Execute Functional Tests
run: |
dotnet build Minio.Functional.Tests --configuration Release
dotnet Minio.Functional.Tests/bin/Release/net6.0/Minio.Functional.Tests.dll

201
.github/workflows/minio-dotnet.yml

@ -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
Directory.Build.props

@ -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>

4
Minio.sln

@ -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
@ -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

4
README.md

@ -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.

Loading…
Cancel
Save