Skip to content

test c# and python on container #45

test c# and python on container

test c# and python on container #45

Workflow file for this run

name: C# tests
on:
push:
branches: ["main"]
paths:
- csharp/**
- glide-core/src/**
- submodules/**
- utils/cluster_manager.py
- .github/workflows/csharp.yml
- .github/workflows/install-shared-dependencies/action.yml
- .github/workflows/test-benchmark/action.yml
- .github/workflows/lint-rust/action.yml
- .github/workflows/install-valkey/action.yml
- .github/workflows/create-test-matrices/action.yml
- .github/json_matrices/**
pull_request:
paths:
- csharp/**
- glide-core/src/**
- submodules/**
- utils/cluster_manager.py
- .github/workflows/csharp.yml
- .github/workflows/install-shared-dependencies/action.yml
- .github/workflows/test-benchmark/action.yml
- .github/workflows/lint-rust/action.yml
- .github/workflows/install-valkey/action.yml
- .github/workflows/create-test-matrices/action.yml
- .github/json_matrices/**
workflow_dispatch:
inputs:
full-matrix:
description: "Run the full engine, host, and language version matrix"
required: false
type: boolean
default: "false"
name:
required: false
type: string
description: "(Optional) Test run name"
workflow_call:
permissions:
contents: read
concurrency:
group: C#-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }}
cancel-in-progress: true
run-name:
# Set custom name if job is started manually and name is given
${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1}', github.ref_name, github.sha) || inputs.name) || '' }}
jobs:
get-matrices:
runs-on: ubuntu-latest
outputs:
engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }}
host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }}
version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }}
steps:
- uses: actions/checkout@v4
- id: get-matrices
uses: ./.github/workflows/create-test-matrices
with:
language-name: dotnet
# Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow
run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }}
test-csharp:
needs: get-matrices
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
dotnet: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }}
engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }}
host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }}
runs-on: ${{ matrix.host.RUNNER }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up dotnet ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
# - name: Install shared software dependencies
# uses: ./.github/workflows/install-shared-dependencies
# with:
# os: ${{ matrix.host.OS }}
# target: ${{ matrix.host.TARGET }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# engine-version: ${{ matrix.engine.version }}
# - name: Test dotnet ${{ matrix.dotnet }}
# working-directory: csharp
# run: dotnet test --framework net${{ matrix.dotnet }} "-l:html;LogFileName=TestReport.html" --results-directory . -warnaserror
# - uses: ./.github/workflows/test-benchmark
# with:
# language-flag: -csharp -dotnet-framework net${{ matrix.dotnet }}
- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ matrix.host.RUNNER }}
path: |
csharp/TestReport.html
benchmarks/results/*
utils/clusters/**
get-containers:
runs-on: ubuntu-latest
# using `needs` instead of `if` to ensure that same condition applied
needs: [get-matrices]
if: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }}
outputs:
engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }}
host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }}
version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }}
steps:
- uses: actions/checkout@v4
- id: get-matrices
uses: ./.github/workflows/create-test-matrices
with:
language-name: dotnet
run-full-matrix: true
containers: true
test-csharp-container:
runs-on: ${{ matrix.host.RUNNER }}
needs: [get-containers]
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
# dotnet: ${{ fromJson(needs.get-containers.outputs.version-matrix-output) }}
engine: ${{ fromJson(needs.get-containers.outputs.engine-matrix-output) }}
host: ${{ fromJson(needs.get-containers.outputs.host-matrix-output) }}
container:
image: ${{ matrix.host.IMAGE }}
options: ${{ join(' -q ', matrix.host.CONTAINER_OPTIONS) }} # adding `-q` to bypass empty options
steps:
- name: Install git
run: |
yum update
yum install -y git tar findutils libicu
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up dotnet ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v4
# with:
# dotnet-version: ${{ matrix.dotnet }}
- name: Install shared software dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
engine-version: ${{ matrix.engine.version }}
- name: Test dotnet ${{ matrix.dotnet }}
working-directory: csharp
# run: dotnet test --framework net${{ matrix.dotnet }} "-l:html;LogFileName=TestReport.html" --results-directory . -warnaserror
run: dotnet test "-l:html;LogFileName=TestReport.html" --results-directory . -warnaserror
- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ matrix.host.IMAGE }}-${{ matrix.host.ARCH }}
path: |
csharp/TestReport.html
benchmarks/results/*
utils/clusters/**
# lint:
# timeout-minutes: 10
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
#
# - name: lint rust
# uses: ./.github/workflows/lint-rust
# with:
# cargo-toml-folder: csharp/lib
# github-token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Format
# working-directory: csharp
# run: dotnet format --verify-no-changes --verbosity diagnostic