chore(deps): update github actions #1170
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: test-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test API | |
strategy: | |
fail-fast: false | |
matrix: | |
language: | |
- lang: C# | |
cmd: dotnet test -f net4.7 --logger "trx;LogFileName=test-results.trx" | |
dir: csharp/ArmoniK.Api.Client.Test | |
dotnet: '' | |
env: {} | |
- lang: C# | |
cmd: dotnet test -f net4.7 --logger "trx;LogFileName=test-results.trx" | |
dir: csharp/ArmoniK.Api.Client.Test | |
dotnet: '' | |
env: | |
GrpcClient__HttpMessageHandler: GrpcWebHandler | |
- lang: C# | |
cmd: dotnet test -f net4.8 --logger "trx;LogFileName=test-results.trx" | |
dir: csharp/ArmoniK.Api.Client.Test | |
dotnet: '' | |
env: {} | |
- lang: C# | |
cmd: dotnet test -f net4.8 --logger "trx;LogFileName=test-results.trx" | |
dir: csharp/ArmoniK.Api.Client.Test | |
dotnet: '' | |
env: | |
GrpcClient__HttpMessageHandler: GrpcWebHandler | |
- lang: C# | |
cmd: dotnet test -f net6.0 --logger "trx;LogFileName=test-results.trx" | |
dir: csharp/ArmoniK.Api.Client.Test | |
dotnet: 6.0 | |
env: {} | |
- lang: C# | |
cmd: dotnet test -f net8.0 --logger "trx;LogFileName=test-results.trx" | |
dir: csharp/ArmoniK.Api.Client.Test | |
dotnet: 8.0 | |
env: {} | |
- lang: C++ | |
cmd: ./tools/run_test.sh | |
dir: cpp | |
env: {} | |
- lang: Python | |
cmd: pytest tests --cov=armonik --cov-config=.coveragerc --cov-report=term-missing --cov-append --cov-report xml:coverage.xml --cov-report html:coverage_report | |
dir: python | |
env: {} | |
- lang: Rust | |
toolchain: stable | |
cmd: cargo test --locked | |
dir: rust/armonik | |
env: {} | |
- lang: Rust | |
toolchain: nightly | |
cmd: cargo test --locked | |
dir: rust/armonik | |
env: {} | |
plateform: | |
- os: ubuntu-latest | |
- os: windows-latest | |
- os: windows-2019 | |
exclude: | |
- language: | |
lang: Python | |
plateform: | |
os: windows-latest | |
- language: | |
lang: C++ | |
plateform: | |
os: windows-latest | |
- language: | |
lang: C++ | |
plateform: | |
os: windows-2019 | |
- language: | |
lang: Python | |
plateform: | |
os: windows-2019 | |
- language: | |
lang: Rust | |
plateform: | |
os: windows-2019 | |
- language: | |
lang: C# | |
dotnet: '' | |
plateform: | |
os: ubuntu-latest | |
runs-on: ${{ matrix.plateform.os }} | |
env: ${{ matrix.language.env }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 0 | |
- name: Generate certs | |
working-directory: packages/csharp/ | |
shell: bash | |
run: | | |
mkdir certs | |
cd certs | |
../../../scripts/certs.sh | |
- name: Install certs | |
if: ${{ matrix.plateform.os == 'ubuntu-latest' }} | |
working-directory: packages/csharp/certs | |
run: | | |
sudo apt install ca-certificates | |
sudo mkdir -p /usr/local/share/ca-certificates/ | |
sudo cp server2-ca.pem /usr/local/share/ca-certificates/ca.crt | |
sudo update-ca-certificates | |
- name: Install certs | |
if: ${{ contains(matrix.plateform.os, 'windows') }} | |
working-directory: packages/csharp/certs | |
run: | | |
certutil -addstore -f "ROOT" server2-ca.pem | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4 | |
if: ${{ matrix.language.dotnet }} != "" | |
with: | |
dotnet-version: ${{ matrix.language.dotnet }} | |
- name: Print language | |
run: | | |
echo "Current language: ${{ matrix.language.lang }}" | |
# Prepare Python | |
- name: pip update and add build package | |
if: ${{ matrix.language.lang == 'Python' }} | |
working-directory: packages/python | |
run: bash proto2python.sh ~/pyvenv | |
- name: Install python dependencies | |
if: ${{ matrix.language.lang == 'Python' }} | |
working-directory: packages/python | |
run: | | |
pwd | |
pip install "$(echo pkg/armonik*.whl)[tests]" | |
# Prepare Rust | |
- uses: taiki-e/install-action@2c3c8dfabf5933531aca0613c6b0c173fa51745e # v2 | |
if: ${{ matrix.language.lang == 'Rust' }} | |
with: | |
tool: protoc,sccache | |
- name: Install Rust toolchain | |
if: ${{ matrix.language.lang == 'Rust' }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.language.toolchain }} | |
components: rust-src,rust-docs,rustfmt${{contains(matrix.language.toolchain, 'nightly') && ',miri' || ''}} | |
- name: Build Rust package | |
if: ${{ matrix.language.lang == 'Rust' }} | |
working-directory: packages/rust/armonik | |
run: | | |
cargo build --locked --tests | |
# Prepare C++ | |
- name: Build C++ package | |
if: ${{ matrix.language.lang == 'C++' }} | |
working-directory: packages/cpp | |
run: | | |
./tools/build_test.sh | |
- name: Build Mock server | |
working-directory: packages/csharp/ArmoniK.Api.Mock | |
shell: bash | |
run: | | |
dotnet publish -o ../out | |
[ -e ../out/ArmoniK.Api.Mock.exe ] || ln -s ArmoniK.Api.Mock ../out/ArmoniK.Api.Mock.exe | |
# Run tests | |
- name: noTLS | |
working-directory: packages/csharp/ | |
shell: bash | |
run: | | |
export Grpc__Port=5000 | |
export Http__Port=4999 | |
export Grpc__Endpoint=http://localhost:5000 | |
export Http__Endpoint=http://localhost:4999 | |
export GrpcClient__Endpoint=http://localhost:5000 | |
export GrpcClient__AllowUnsafeConnection=true | |
../../scripts/mock_test.sh ${{ matrix.language.dir }} '${{ matrix.language.cmd }}' | |
- name: TLS Insecure | |
if: ${{ contains(fromJson('["C#", "Rust"]'), matrix.language.lang) }} | |
working-directory: packages/csharp/ | |
shell: bash | |
run: | | |
export Grpc__Port=5001 | |
export Http__Port=5001 | |
export Http__Cert=certs/server1.pem | |
export Http__Key=certs/server1.key | |
export Grpc__Endpoint=https://localhost:5001 | |
export Http__Endpoint=https://localhost:5001 | |
export Grpc__AllowUnsafeConnection=true | |
export GrpcClient__Endpoint=https://localhost:5001 | |
export GrpcClient__AllowUnsafeConnection=true | |
../../scripts/mock_test.sh ${{ matrix.language.dir }} '${{ matrix.language.cmd }}' | |
- name: TLS secure | |
working-directory: packages/csharp/ | |
shell: bash | |
run: | | |
export CertFolder="$PWD/certs" | |
export Grpc__Port=5001 | |
export Http__Port=5001 | |
export Http__Cert=certs/server1.pem | |
export Http__Key=certs/server1.key | |
export Grpc__Endpoint=https://localhost:5001 | |
export Http__Endpoint=https://localhost:5001 | |
export Grpc__CaCert=certs/server1-ca.pem | |
export GrpcClient__Endpoint=https://localhost:5001 | |
export GrpcClient__AllowUnsafeConnection=false | |
export GrpcClient__CaCert=$CertFolder/server1-ca.pem | |
../../scripts/mock_test.sh ${{ matrix.language.dir }} '${{ matrix.language.cmd }}' | |
- name: TLS store | |
working-directory: packages/csharp/ | |
shell: bash | |
run: | | |
export Grpc__Port=5002 | |
export Http__Port=5002 | |
export Http__Cert=certs/server2.pem | |
export Http__Key=certs/server2.key | |
export Grpc__Endpoint=https://localhost:5002 | |
export Http__Endpoint=https://localhost:5002 | |
export GrpcClient__Endpoint=https://localhost:5002 | |
export GrpcClient__AllowUnsafeConnection=false | |
../../scripts/mock_test.sh ${{ matrix.language.dir }} '${{ matrix.language.cmd }}' | |
- name: mTLS Insecure | |
if: ${{ contains(fromJson('["C#", "Rust"]'), matrix.language.lang) }} | |
working-directory: packages/csharp/ | |
shell: bash | |
run: | | |
export CertFolder="$PWD/certs" | |
export Grpc__Port=5003 | |
export Http__Port=5003 | |
export Http__Cert=certs/server1.pem | |
export Http__Key=certs/server1.key | |
export Grpc__Endpoint=https://localhost:5003 | |
export Http__Endpoint=https://localhost:5003 | |
export Grpc__ClientCert=certs/client.pem | |
export Grpc__ClientKey=certs/client.key | |
export GrpcClient__Endpoint=https://localhost:5003 | |
export GrpcClient__AllowUnsafeConnection=true | |
export GrpcClient__CertPem=$CertFolder/client.pem | |
export GrpcClient__KeyPem=$CertFolder/client.key | |
../../scripts/mock_test.sh ${{ matrix.language.dir }} '${{ matrix.language.cmd }}' | |
- name: mTLS secure | |
working-directory: packages/csharp/ | |
shell: bash | |
run: | | |
export CertFolder="$PWD/certs" | |
export Grpc__Port=5003 | |
export Http__Port=5003 | |
export Http__Cert=certs/server1.pem | |
export Http__Key=certs/server1.key | |
export Http__ClientCert=certs/client-ca.pem | |
export Grpc__Endpoint=https://localhost:5003 | |
export Http__Endpoint=https://localhost:5003 | |
export Grpc__CaCert=certs/server1-ca.pem | |
export Grpc__ClientCert=certs/client.pem | |
export Grpc__ClientKey=certs/client.key | |
export GrpcClient__Endpoint=https://localhost:5003 | |
export GrpcClient__AllowUnsafeConnection=false | |
export GrpcClient__CaCert=$CertFolder/server1-ca.pem | |
export GrpcClient__CertPem=$CertFolder/client.pem | |
export GrpcClient__KeyPem=$CertFolder/client.key | |
../../scripts/mock_test.sh ${{ matrix.language.dir }} '${{ matrix.language.cmd }}' | |
- name: mTLS store | |
working-directory: packages/csharp/ | |
shell: bash | |
run: | | |
export CertFolder="$PWD/certs" | |
export Grpc__Port=5004 | |
export Http__Port=5004 | |
export Http__Cert=certs/server2.pem | |
export Http__Key=certs/server2.key | |
export Http__ClientCert=certs/client-ca.pem | |
export Grpc__Endpoint=https://localhost:5004 | |
export Http__Endpoint=https://localhost:5004 | |
export Grpc__ClientCert=certs/client.pem | |
export Grpc__ClientKey=certs/client.key | |
export GrpcClient__Endpoint=https://localhost:5004 | |
export GrpcClient__AllowUnsafeConnection=false | |
export GrpcClient__CertPem=$CertFolder/client.pem | |
export GrpcClient__KeyPem=$CertFolder/client.key | |
../../scripts/mock_test.sh ${{ matrix.language.dir }} '${{ matrix.language.cmd }}' | |
- name: Test Report | |
uses: dorny/test-reporter@v1 | |
if: ${{ matrix.language.lang == 'C#' && always() }} | |
with: | |
name: ConnectivityTests ${{ matrix.plateform.os }} ${{ matrix.dotnet.framework }} ${{ matrix.language.handler }} | |
path: ./packages/csharp/ArmoniK.Api.Client.Test/TestResults/test-results.trx | |
reporter: dotnet-trx | |
- name: Get Cover Python | |
uses: orgoro/coverage@3f13a558c5af7376496aa4848bf0224aead366ac | |
if: ${{ matrix.language.lang == 'Python' && always() }} | |
with: | |
coverageFile: packages/python/coverage.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Archive code coverage results html | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b | |
if: ${{ matrix.language.lang == 'Python' && always() }} | |
with: | |
name: code-coverage-report-html | |
path: packages/python/coverage_report | |
- name: Archive code coverage results xml | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b | |
if: ${{ matrix.language.lang == 'Python' && always() }} | |
with: | |
name: code-coverage-report-xml | |
path: packages/python/coverage.xml |