From fd65bbfa3ffb93f780ef84513e623ed4315847f0 Mon Sep 17 00:00:00 2001 From: Rinne Date: Fri, 28 Apr 2023 23:43:45 +0800 Subject: [PATCH] Create dotnet.yml to config github action --- .github/workflows/dotnet.yml | 87 ++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000..3035a804 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,87 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build-and-test-on-windows-cpu: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + + build-and-test-on-windows-gpu: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: uninstall redist cpu on binding test + run: dotnet remove Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist + - name: install redist gpu on keras test + run: dotnet add Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist-Windows-GPU + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + + build-and-test-on-linux-cpu: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + + build-and-test-on-linux-gpu: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: uninstall redist cpu on binding test + run: dotnet remove Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist + - name: install redist gpu on keras test + run: dotnet add Tensorflow.UnitTest.RedistHolder package SciSharp.TensorFlow.Redist-Linux-GPU + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal