From fe0208e71b5ab4281b081af6ab5a17bea29b66a1 Mon Sep 17 00:00:00 2001 From: Pierce Andjelkovic Date: Mon, 1 Jan 2024 15:17:28 +1100 Subject: [PATCH] oops --- .github/workflows/docs.yml | 7 +---- .github/workflows/dotnet.yml | 57 ++++++++++++++++++------------------ .github/workflows/nuget.yml | 24 +++++++-------- 3 files changed, 40 insertions(+), 48 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index af9a5e9..fffe3a6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,20 +1,17 @@ name: Documentation - on: push: branches: - - main + - master permissions: actions: read pages: write id-token: write env: dotnet-version: 8.0.x - concurrency: group: "pages" cancel-in-progress: false - jobs: deploy-docs: name: Deploy Docs @@ -33,10 +30,8 @@ jobs: run: dotnet restore - name: Build run: dotnet build --no-restore - - run: dotnet tool update -g docfx - run: docfx docfx.json - - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 654d93a..549d636 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,12 +1,10 @@ name: Build & Test - on: push: branches: - - main + - master env: dotnet-version: 8.0.x - jobs: build: runs-on: ubuntu-latest @@ -20,34 +18,35 @@ jobs: run: dotnet restore - name: Build run: dotnet build --no-restore -c Release - test: name: Run Tests needs: [build] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ env.dotnet-version }} - - name: Test with dotnet - run: dotnet test --logger trx --results-directory "TestResults-${{ env.dotnet-version }}" - - name: Upload dotnet test results - uses: actions/upload-artifact@v4 - with: - name: dotnet-results-${{ env.dotnet-version }} - path: TestResults-${{ env.dotnet-version }} - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: altcover - run: dotnet test /p:AltCover=true /p:AltCoverAssemblyFilter="testhost|Microsoft" - - name: Run codacy-coverage-reporter - uses: codacy/codacy-coverage-reporter-action@v1 - with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - coverage-reports: "KartaViewSharp.Tests/coverage.net8.0.xml" - if: ${{ always() }} \ No newline at end of file + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.dotnet-version }} + - name: Test with dotnet + run: dotnet test --logger trx --results-directory "TestResults-${{ env.dotnet-version }}" + - name: Upload dotnet test results + uses: actions/upload-artifact@v4 + with: + name: dotnet-results-${{ env.dotnet-version }} + path: TestResults-${{ env.dotnet-version }} + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + - name: altcover + run: dotnet test /p:AltCover=true /p:AltCoverAssemblyFilter="testhost|Microsoft" + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: "KartaViewSharp.Tests/coverage.net8.0.xml" + if: ${{ always() }} + - name: Run codacy-coverage-reporter + uses: codacy/codacy-coverage-reporter-action@v1 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: "KartaViewSharp.Tests/coverage.net8.0.xml" + if: ${{ always() }} \ No newline at end of file diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 0044d1c..77f5d57 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -1,9 +1,7 @@ name: Upload dotnet package - on: release: types: [created] - jobs: deploy: runs-on: ubuntu-latest @@ -11,14 +9,14 @@ jobs: packages: write contents: read steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - run: dotnet build --configuration Release KartaViewSharp - - name: Create the package - run: dotnet pack --configuration Release KartaViewSharp - - name: Publish the package to nuget - run: dotnet nuget push KartaViewSharp/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}} \ No newline at end of file + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + - run: dotnet build --configuration Release KartaViewSharp + - name: Create the package + run: dotnet pack --configuration Release KartaViewSharp + - name: Publish the package to nuget + run: dotnet nuget push KartaViewSharp/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json + env: + NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}} \ No newline at end of file