diff --git a/.github/actions/c#/action.yml b/.github/actions/c#/action.yml index 4e6bc2e4..88350799 100644 --- a/.github/actions/c#/action.yml +++ b/.github/actions/c#/action.yml @@ -8,7 +8,7 @@ runs: submodules: true - uses: actions/setup-dotnet@v4 with: # https://github.com/actions/setup-dotnet/tree/v4 - dotnet-version: 7 + global-json-file: c#/global.json # cache: true # # https://github.com/actions/setup-node/issues/624#issuecomment-1328681525 # cache-dependency-path: ${{ github.workspace }}/c#/*/packages.lock.json @@ -18,14 +18,15 @@ runs: - id: cache-restore uses: actions/cache/restore@v4 with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + path: | + ${{ github.workspace }}/.nuget/packages + ${{ github.workspace }}/.resharper + key: | + ${{ runner.os }}-nuget- + ${{ hashFiles('c#/*/packages.lock.json') }}- restore-keys: ${{ runner.os }}-nuget- - - run: dotnet new globaljson --sdk-version 7.0.405 - working-directory: c# - shell: bash - - run: dotnet restore + - run: dotnet restore --locked-mode working-directory: c# shell: bash @@ -34,5 +35,7 @@ runs: - uses: actions/cache/save@v4 if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }} with: - path: ~/.nuget/packages + path: | + ${{ github.workspace }}/.nuget/packages + ${{ github.workspace }}/.resharper key: ${{ steps.cache-restore.outputs.cache-primary-key }} diff --git a/.github/workflows/c#.yml b/.github/workflows/c#.yml index 82973276..e68adb95 100644 --- a/.github/workflows/c#.yml +++ b/.github/workflows/c#.yml @@ -11,7 +11,21 @@ jobs: strategy: matrix: project: [crawler, imagePipeline, shared, tbClient] + env: + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages steps: - uses: actions/checkout@v4 - uses: ./.github/actions/c# - run: dotnet build --no-restore -c Debug ${{ matrix.project }} + + ReSharper: + runs-on: ubuntu-latest + env: + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/c# + - uses: muno92/resharper_inspectcode@v1 + with: + solutionPath: c#/tbm.sln + cachesHome: ${{ github.workspace }}/.resharper diff --git a/c#/global.json b/c#/global.json new file mode 100644 index 00000000..3306bd68 --- /dev/null +++ b/c#/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "8.0.0", + "rollForward": "latestFeature" // https://github.com/actions/setup-dotnet/pull/481 + } +}