Skip to content

Commit

Permalink
C#: rework CI to run tests and minimal benchmark (#108)
Browse files Browse the repository at this point in the history
* Update CI.

Signed-off-by: Yury-Fridlyand <[email protected]>

* typo fix

Signed-off-by: Yury-Fridlyand <[email protected]>

* typo fix

Signed-off-by: Yury-Fridlyand <[email protected]>

* TreatWarningsAsErrors

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* experiment

Signed-off-by: Yury-Fridlyand <[email protected]>

* Stop experimenting

Signed-off-by: Yury-Fridlyand <[email protected]>

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand authored Feb 27, 2024
1 parent a35ed7d commit 5ab045c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
50 changes: 37 additions & 13 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,88 @@ on:
- 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

jobs:
run-tests:
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
redis:
- 6.2.14
- 7.2.3
dotnet:
- 6.0
- 8.0
- '6.0'
- '8.0'
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
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/[email protected]
- 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

- uses: ./.github/workflows/test-benchmark
with:
language-flag: -csharp

- 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


- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
language-flag: -csharp
name: test-reports-dotnet-${{ matrix.dotnet }}-redis-${{ matrix.redis }}-${{ matrix.os }}
path: |
csharp/TestReport.html
benchmarks/results/*
lint-rust:
timeout-minutes: 10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
shell: bash
if: "${{ inputs.os == 'macos-latest' }}"
run: |
brew install git gcc pkgconfig openssl redis
brew install git gcc pkgconfig openssl redis coreutils
- name: Install software dependencies for Ubuntu
shell: bash
Expand Down
1 change: 1 addition & 0 deletions csharp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ ClientBin/
*~
*.dbmdl
*.[Pp]ublish.xml
*.html

*.publishsettings

Expand Down

0 comments on commit 5ab045c

Please sign in to comment.