From 55a4ce52292757d64c1a712e7454c100fa3977bf Mon Sep 17 00:00:00 2001 From: Arjen Kroezen Date: Thu, 31 Aug 2023 08:41:10 +0200 Subject: [PATCH] ci: add ci.yml (#4) --- .github/workflows/ci.yml | 44 +++++++++++++++++++ .../AzureDataFactory.TestingFramework.csproj | 9 +++- src/nuget.config | 12 +++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 src/nuget.config diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..de45136a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + matrix: + dotnet-version: [ '7.0.x' ] + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ matrix.dotnet-version }} + source-url: https://nuget.pkg.github.com/arjendev/index.json + env: + NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Install dependencies + run: dotnet restore + working-directory: ./src + - name: Build + run: dotnet build --configuration Release --no-restore + working-directory: ./src + - name: Test + run: dotnet test --no-restore --verbosity normal + working-directory: ./src + - name: Upload dotnet test results + uses: actions/upload-artifact@v3 + with: + name: dotnet-results-${{ matrix.dotnet-version }} + path: ./src/TestResults-${{ matrix.dotnet-version }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + - name: Create the package + run: dotnet pack --configuration Release src/AzureDataFactory.TestingFramework + - name: Publish the package to GPR + run: dotnet nuget push src/AzureDataFactory.TestingFramework/bin/Release/*.nupkg --source "https://nuget.pkg.github.com/arjendev/index.json" --api-key ${{ secrets.PUBLISH_KEY }} --skip-duplicate \ No newline at end of file diff --git a/src/AzureDataFactory.TestingFramework/AzureDataFactory.TestingFramework.csproj b/src/AzureDataFactory.TestingFramework/AzureDataFactory.TestingFramework.csproj index 2459efd4..e591008e 100644 --- a/src/AzureDataFactory.TestingFramework/AzureDataFactory.TestingFramework.csproj +++ b/src/AzureDataFactory.TestingFramework/AzureDataFactory.TestingFramework.csproj @@ -3,7 +3,6 @@ net7.0 enable enable - https://azuresdkartifacts.blob.core.windows.net/azure-sdk-tools/index.json annotations true @@ -11,8 +10,14 @@ - + + + AzureDataFactory.TestingFramework + 0.1.0-alpha + arjendev + true + diff --git a/src/nuget.config b/src/nuget.config new file mode 100644 index 00000000..40f5bd08 --- /dev/null +++ b/src/nuget.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file