From bb3d75521ed7de3f44879d4dc08f1acb44e47e85 Mon Sep 17 00:00:00 2001 From: mdnapo Date: Sun, 6 Oct 2024 12:19:11 +0200 Subject: [PATCH] Testing build action --- .gitea/workflows/build.yml | 24 ++++++++++++++++++++++++ .gitea/workflows/gitea-ci.yml | 21 --------------------- .gitea/workflows/test.yml | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 .gitea/workflows/build.yml delete mode 100644 .gitea/workflows/gitea-ci.yml create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..1a0d942 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,24 @@ +name: Build MycroForge.CLI +run-name: ${{ gitea.actor }} triggered a build for the MycroForge.CLI +on: [ push ] + +jobs: + test: + runs-on: ubuntu-latest +# if: gitea.ref == 'refs/heads/main' + steps: + - uses: https://github.com/actions/checkout@v4 + - uses: https://github.com/actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' + - name: "Build MycroForge.CLI as a NuGet package" + run: dotnet pack -v d + - name: "Add package source" + run: | + dotnet nuget add source --name devdisciples \ + --username ${{secrets.NUGET_USER}} \ + --password ${{ NUGET_PASS }} \ + --store-password-in-clear-text \ + https://git.devdisciples.com/api/packages/devdisciples/nuget/index.json + - name: "Run MycroForge.CLI.Tests" + run: dotnet nuget push nupkg/MycroForge.CLI.1.0.1.nupkg --source devdisciples diff --git a/.gitea/workflows/gitea-ci.yml b/.gitea/workflows/gitea-ci.yml deleted file mode 100644 index b56e133..0000000 --- a/.gitea/workflows/gitea-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Test and build -run-name: ${{ gitea.actor }} is building MycroForge.CLI -on: [ push ] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: https://github.com/actions/checkout@v4 - - uses: https://github.com/actions/setup-dotnet@v4 - with: - dotnet-version: '8.x' -# - name: "Run dotnet restore" -# run: dotnet restore -# - name: "Run dotnet build" -# run: dotnet build --no-restore - - name: "Reference MycroForge.Core in MycroForge.PluginTemplate" - run: dotnet add MycroForge.PluginTemplate reference MycroForge.Core - - name: "Run MycroForge.CLI.Tests" -# run: dotnet test --no-build --verbosity normal - run: dotnet test diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..4c05364 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,20 @@ +name: Test MycroForge.CLI +run-name: ${{ gitea.actor }} triggered a test for the MycroForge.CLI +on: [ push ] + +jobs: + test: + runs-on: ubuntu-latest + if: gitea.ref == 'refs/heads/main' + steps: + - uses: https://github.com/actions/checkout@v4 + - uses: https://github.com/actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' + - name: "Reference MycroForge.Core in MycroForge.PluginTemplate" + # The MycroForge.PluginTemplate project references MycroForge.Core as a package and not as a reference. + # This allows the 'm4g plugin init' command to pull in the core package from a package repository. + # To prevent the test command from trying to pull from the package repository, we reference the local project. + run: dotnet add MycroForge.PluginTemplate reference MycroForge.Core + - name: "Run MycroForge.CLI.Tests" + run: dotnet test