From 10addae991bcd24d99d74649ef7cf24a94a85d81 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 14 Mar 2026 12:17:40 -0500 Subject: [PATCH 1/3] add GHA ci --- .github/workflows/ci.yml | 84 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..7b5f9b85c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,84 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Add dotnet tools to PATH + run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH + + - name: Install dotnet-sonarscanner + run: dotnet tool install --global dotnet-sonarscanner --version 5.4.1 + + - name: Set Sonar options + id: sonar-options + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "options=/d:sonar.pullrequest.base=${{ github.base_ref }} /d:sonar.pullrequest.branch=${{ github.head_ref }} /d:sonar.pullrequest.key=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT + else + echo "options=/d:sonar.branch.name=${{ github.ref_name }}" >> $GITHUB_OUTPUT + fi + + - name: SonarCloud begin + run: | + dotnet-sonarscanner begin \ + /key:"jpdillingham_Soulseek.NET" \ + /o:jpdillingham-github \ + ${{ steps.sonar-options.outputs.options }} \ + /d:sonar.host.url="https://sonarcloud.io" \ + /d:sonar.github.repository="jpdillingham/Soulseek.NET" \ + /d:sonar.exclusions="**/*examples*/**" \ + /d:sonar.cs.opencover.reportsPaths="tests/opencover.xml" \ + /d:sonar.login="${{ secrets.TOKEN_SONARCLOUD }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + dotnet restore + dotnet build --no-restore --no-incremental --configuration Release + + - name: Test + run: | + dotnet test --verbosity minimal --no-build --configuration Release --blame \ + -p:CollectCoverage=true \ + -p:CoverletOutput="../coverage.json" \ + -p:Include="[Soulseek]*" \ + tests/Soulseek.Tests.Unit + dotnet test --verbosity minimal --no-build --configuration Release --blame \ + -p:CollectCoverage=true \ + -p:MergeWith="../coverage.json" \ + -p:CoverletOutput="../opencover.xml" \ + -p:CoverletOutputFormat=opencover \ + -p:Include="[Soulseek]*" \ + tests/Soulseek.Tests.Integration + + - name: SonarCloud end + run: dotnet-sonarscanner end /d:sonar.login="${{ secrets.TOKEN_SONARCLOUD }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: codecov/codecov-action@v4 + with: + files: tests/opencover.xml + token: ${{ secrets.TOKEN_CODECOV_SOULSEEKNET }} From 1261da0c216b5087eecf4dc19d1787080a905b13 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 14 Mar 2026 12:52:51 -0500 Subject: [PATCH 2/3] add envars explicitly --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b5f9b85c..cb5c695d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,9 @@ jobs: dotnet build --no-restore --no-incremental --configuration Release - name: Test + env: + SLSK_INTEGRATION_USERNAME: ${{ secrets.SLSK_INTEGRATION_USERNAME }} + SLSK_INTEGRATION_PASSWORD: ${{ secrets.SLSK_INTEGRATION_PASSWORD }} run: | dotnet test --verbosity minimal --no-build --configuration Release --blame \ -p:CollectCoverage=true \ From 8caf0a8c6c52fd7765097635e7cccdee3290634e Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 14 Mar 2026 12:56:41 -0500 Subject: [PATCH 3/3] disable integration tests and circleci config --- .circleci/config.yml | 30 +++++++++++++++--------------- .github/workflows/ci.yml | 18 +++++++++++------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 99d51fa9e..82dea1037 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,15 +1,15 @@ -version: 2.1 -jobs: - build: - docker: - - image: mcr.microsoft.com/dotnet/sdk:8.0 - steps: - - checkout - - run: find . - - run: apt-get update - - run: apt-get install jq -y - - run: mkdir -p /usr/share/man/man1 - - run: apt-get install openjdk-17-jre-headless -y - - run: echo 'export PATH=$HOME/.dotnet/tools:$PATH' >> $BASH_ENV - - run: dotnet tool install --global dotnet-sonarscanner --version 5.4.1 - - run: bash ./bin/ci +# version: 2.1 +# jobs: +# build: +# docker: +# - image: mcr.microsoft.com/dotnet/sdk:8.0 +# steps: +# - checkout +# - run: find . +# - run: apt-get update +# - run: apt-get install jq -y +# - run: mkdir -p /usr/share/man/man1 +# - run: apt-get install openjdk-17-jre-headless -y +# - run: echo 'export PATH=$HOME/.dotnet/tools:$PATH' >> $BASH_ENV +# - run: dotnet tool install --global dotnet-sonarscanner --version 5.4.1 +# - run: bash ./bin/ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb5c695d2..c43133c37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,13 +68,17 @@ jobs: -p:CoverletOutput="../coverage.json" \ -p:Include="[Soulseek]*" \ tests/Soulseek.Tests.Unit - dotnet test --verbosity minimal --no-build --configuration Release --blame \ - -p:CollectCoverage=true \ - -p:MergeWith="../coverage.json" \ - -p:CoverletOutput="../opencover.xml" \ - -p:CoverletOutputFormat=opencover \ - -p:Include="[Soulseek]*" \ - tests/Soulseek.Tests.Integration + # -------------------------- + # integration tests temporarily(?) disabled to prevent GHA from connecting to the remote soulseek server, + # risking my account. eventually i'll boot the soulfind docker container and run the integration tests against it + # -------------------------- + # dotnet test --verbosity minimal --no-build --configuration Release --blame \ + # -p:CollectCoverage=true \ + # -p:MergeWith="../coverage.json" \ + # -p:CoverletOutput="../opencover.xml" \ + # -p:CoverletOutputFormat=opencover \ + # -p:Include="[Soulseek]*" \ + # tests/Soulseek.Tests.Integration - name: SonarCloud end run: dotnet-sonarscanner end /d:sonar.login="${{ secrets.TOKEN_SONARCLOUD }}"