diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 0000000..4b97a7d --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,28 @@ +name: Qodana +on: + workflow_dispatch: + pull_request: + push: + +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@main + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + QODANA_NUGET_URL: ${{ secrets.QODANA_NUGET_URL }} + QODANA_NUGET_USER: ${{ secrets.QODANA_NUGET_USER }} + QODANA_NUGET_PASSWORD: ${{ secrets.QODANA_NUGET_PASSWORD }} + with: + upload-result: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb6cf7b --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +*.swp +*.*~ +project.lock.json +.DS_Store +*.pyc +nupkg/ + +.vscode/ + +.idea/ + +.vs/ + +.fleet/ + +.cr/ + +*.suo +*.user +*.userosscache +*.sln.docstates + +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +msbuild.log +msbuild.err +msbuild.wrn \ No newline at end of file diff --git a/QodanaPrivateFeed.sln b/QodanaPrivateFeed.sln new file mode 100644 index 0000000..912ef72 --- /dev/null +++ b/QodanaPrivateFeed.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QodanaPrivateFeed", "QodanaPrivateFeed\QodanaPrivateFeed.csproj", "{C96473E7-B190-4ED9-8A28-9B235AFF68C1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C96473E7-B190-4ED9-8A28-9B235AFF68C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C96473E7-B190-4ED9-8A28-9B235AFF68C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C96473E7-B190-4ED9-8A28-9B235AFF68C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C96473E7-B190-4ED9-8A28-9B235AFF68C1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/QodanaPrivateFeed/FooBar.cs b/QodanaPrivateFeed/FooBar.cs new file mode 100644 index 0000000..9cbb933 --- /dev/null +++ b/QodanaPrivateFeed/FooBar.cs @@ -0,0 +1,9 @@ +namespace QodanaPrivateFeed; +using PrivatePackage; +public class FooBar +{ + public static void UsePackage() + { + Class1.Foo(); + } +} \ No newline at end of file diff --git a/QodanaPrivateFeed/QodanaPrivateFeed.csproj b/QodanaPrivateFeed/QodanaPrivateFeed.csproj new file mode 100644 index 0000000..a86bf3f --- /dev/null +++ b/QodanaPrivateFeed/QodanaPrivateFeed.csproj @@ -0,0 +1,13 @@ + + + + net7.0 + enable + enable + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..7405537 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +## Example of using Qodana for .NET with private NuGet feed + +To use private NuGet feeds in Qodana for .NET, you can add the following environmental variables to your job: +* `QODANA_NUGET_URL=URL` - your NuGet feed url, e.g. `https://nuget.pkg.github.com/brichbash/index.json` +* `QODANA_NUGET_USER=LOGIN` +* `QODANA_NUGET_PASSWORD=PASSWORD` + +See the example configuration for GitHub Actions in `./.github/workflows/code-quality.yml` \ No newline at end of file diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 0000000..f0551c3 --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,22 @@ +image: atlassian/default-image:4 + +pipelines: + branches: + main: + - step: + name: Qodana + caches: + - qodana + image: jetbrains/qodana-dotnet:latest + script: + - export QODANA_TOKEN=$QODANA_TOKEN + - export QODANA_NUGET_URL=$QODANA_NUGET_URL + - export QODANA_NUGET_PASSWORD=$QODANA_NUGET_PASSWORD + - export QODANA_NUGET_USER=$QODANA_NUGET_USER + - qodana --results-dir=$BITBUCKET_CLONE_DIR/.qodana --report-dir=$BITBUCKET_CLONE_DIR/.qodana/report --cache-dir=$BITBUCKET_CLONE_DIR/.qodana/cache + artifacts: + - .qodana/report + +definitions: + caches: + qodana: .qodana/cache \ No newline at end of file diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 0000000..bff49b1 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,4 @@ +version: 1.0 +linter: jetbrains/qodana-dotnet:latest +dotnet: + project: QodanaPrivateFeed.csproj