diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index dafb45bf25..774b9fcea5 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -2,18 +2,26 @@ name: C# tests on: push: - branches: ["main"] +# branches: ["main"] paths: - csharp/** - glide-core/** - submodules/** - .github/workflows/csharp.yml + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/install-redis/action.yml + - .github/workflows/test-benchmark/action.yml + - .github/workflows/lint-rust/action.yml pull_request: paths: - csharp/** - glide-core/src/** - submodules/** - .github/workflows/csharp.yml + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/install-redis/action.yml + - .github/workflows/test-benchmark/action.yml + - .github/workflows/lint-rust/action.yml permissions: contents: read @@ -31,6 +39,9 @@ jobs: dotnet: - 6.0 - 8.0 + os: + - ubuntu-latest + - macos-latest steps: - uses: actions/checkout@v4 @@ -38,35 +49,45 @@ jobs: submodules: recursive - name: Install redis + # TODO: make this step macos compatible: https://github.com/aws/glide-for-redis/issues/781 + if: ${{ matrix.os == 'ubuntu-latest' }} uses: ./.github/workflows/install-redis with: redis-version: ${{ matrix.redis }} - - name: Install protoc (protobuf) - uses: arduino/setup-protoc@v2.1.0 + - name: Install shared software dependencies + uses: ./.github/workflows/install-shared-dependencies with: - version: "25.1" + os: ${{ matrix.os }} + target: ${{ matrix.os == 'ubuntu-latest' && 'x86_64-unknown-linux-gnu' || 'x86_64-apple-darwin' }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Set up dotnet ${{ matrix.dotnet }} - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ matrix.dotnet }} - - name: Start redis server - run: redis-server & - - name: Format working-directory: ./csharp run: dotnet format --verify-no-changes --verbosity diagnostic - name: Test dotnet ${{ matrix.dotnet }} working-directory: ./csharp - run: dotnet test --framework net${{ matrix.dotnet }} /warnaserror + run: dotnet test --framework net${{ matrix.dotnet }} "-l:html;LogFileName=TestReport.html" --results-directory . /warnaserror - uses: ./.github/workflows/test-benchmark with: language-flag: -csharp + - name: Upload test reports + if: always() + continue-on-error: true + uses: actions/upload-artifact@v4 + with: + name: test-reports-dotnet-${{ matrix.dotnet }}-redis-${{ matrix.redis }}-${{ matrix.os }} + path: | + csharp/TestReport.html + lint-rust: timeout-minutes: 10 runs-on: ubuntu-latest diff --git a/csharp/.gitignore b/csharp/.gitignore index 92e9f50cc3..71475a2a33 100644 --- a/csharp/.gitignore +++ b/csharp/.gitignore @@ -94,6 +94,7 @@ ClientBin/ *~ *.dbmdl *.[Pp]ublish.xml +*.html *.publishsettings