Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
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
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 \
-p:CoverletOutput="../coverage.json" \
-p:Include="[Soulseek]*" \
tests/Soulseek.Tests.Unit
# --------------------------
# 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 }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: codecov/codecov-action@v4
with:
files: tests/opencover.xml
token: ${{ secrets.TOKEN_CODECOV_SOULSEEKNET }}
Loading