From 6cbf51a05b84ccc5c38b0d75ee0529dac6155198 Mon Sep 17 00:00:00 2001 From: Brett Webster Date: Sun, 4 Aug 2024 16:29:41 -0500 Subject: [PATCH] Adding tests and updating the CI to utilize workflows (#51) * renamed a few test files. tested the dropna function * indexer tests * subtraction * Subtract, divide, and equals * DataFrame operators - equality * added pop test * Sample test added. Added support for sample with replace. * Create ubuntu-dotnet.yml * Update ubuntu-dotnet.yml * Remove reference to TensorFlow.NET * Update PandasConsole.indexers.cs * Update and rename ubuntu-dotnet.yml to build-and-test.yml * ubuntu, windows, and macos ci * fixing macos file 1 * mac os dependencies * macox test * another test * more tweaks * fixing up the macos build * more ci work * removed tensorflow from test package * disable the macos test for now --- .github/workflows/build-and-test.yml | 32 +++++++++++++++++++ .github/workflows/macos-ci.yml | 26 +++++++++++++++ .github/workflows/ubuntu-ci.yml | 26 +++++++++++++++ .github/workflows/windows-ci.yml | 26 +++++++++++++++ ci-build/mac-ci-pipeline.yml | 28 ---------------- ci-build/ubuntu-ci-pipeline.yml | 28 ---------------- ci-build/win-ci-pipeline.yml | 28 ---------------- src/Pandas.NET/Pandas.NET.csproj | 2 +- test/Pandas.NET.Test/Pandas.NET.Test.csproj | 1 - .../DataFrames/PandasConsole.indexers.cs | 4 +-- 10 files changed, 113 insertions(+), 88 deletions(-) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/macos-ci.yml create mode 100644 .github/workflows/ubuntu-ci.yml create mode 100644 .github/workflows/windows-ci.yml delete mode 100644 ci-build/mac-ci-pipeline.yml delete mode 100644 ci-build/ubuntu-ci-pipeline.yml delete mode 100644 ci-build/win-ci-pipeline.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..0fe0bf9 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,32 @@ +# 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: Build and Test +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build_matrix: + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml new file mode 100644 index 0000000..f8e5ff5 --- /dev/null +++ b/.github/workflows/macos-ci.yml @@ -0,0 +1,26 @@ +# 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: MacOS Build and Test +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + #- name: Test + # run: dotnet test --no-build --verbosity normal \ No newline at end of file diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml new file mode 100644 index 0000000..779c6ce --- /dev/null +++ b/.github/workflows/ubuntu-ci.yml @@ -0,0 +1,26 @@ +# 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: Ubuntu Build and Test +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal \ No newline at end of file diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml new file mode 100644 index 0000000..6c6ab72 --- /dev/null +++ b/.github/workflows/windows-ci.yml @@ -0,0 +1,26 @@ +# 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: Windows Build and Test +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal \ No newline at end of file diff --git a/ci-build/mac-ci-pipeline.yml b/ci-build/mac-ci-pipeline.yml deleted file mode 100644 index 55b9ca1..0000000 --- a/ci-build/mac-ci-pipeline.yml +++ /dev/null @@ -1,28 +0,0 @@ -pool: - vmImage: 'macOS-12' - -variables: - solution: '**/*.sln' - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - -steps: -- task: NuGetToolInstaller@1 - -- task: NuGetCommand@2 - inputs: - restoreSolution: '$(solution)' - -- task: DotNetCoreCLI@2 - inputs: - command: build - projects: '$(solution)' - configuration: '$(buildConfiguration)' - arguments: '--configuration $(buildConfiguration) -p:Platform="$(buildPlatform)"' - -- task: DotNetCoreCLI@2 - inputs: - command: test - projects: '$(solution)' - configuration: '$(buildConfiguration)' - arguments: '--configuration $(buildConfiguration) -p:Platform="$(buildPlatform)"' diff --git a/ci-build/ubuntu-ci-pipeline.yml b/ci-build/ubuntu-ci-pipeline.yml deleted file mode 100644 index 7ded755..0000000 --- a/ci-build/ubuntu-ci-pipeline.yml +++ /dev/null @@ -1,28 +0,0 @@ -pool: - vmImage: 'ubuntu-22.04' - -variables: - solution: '**/*.sln' - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - -steps: -- task: NuGetToolInstaller@1 - -- task: NuGetCommand@2 - inputs: - restoreSolution: '$(solution)' - -- task: DotNetCoreCLI@2 - inputs: - command: build - projects: '$(solution)' - configuration: '$(buildConfiguration)' - arguments: '--configuration $(buildConfiguration) -p:Platform="$(buildPlatform)"' - -- task: DotNetCoreCLI@2 - inputs: - command: test - projects: '$(solution)' - configuration: '$(buildConfiguration)' - arguments: '--configuration $(buildConfiguration) -p:Platform="$(buildPlatform)"' diff --git a/ci-build/win-ci-pipeline.yml b/ci-build/win-ci-pipeline.yml deleted file mode 100644 index 642fd51..0000000 --- a/ci-build/win-ci-pipeline.yml +++ /dev/null @@ -1,28 +0,0 @@ -pool: - vmImage: 'windows-2022' - -variables: - solution: '**/*.sln' - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - -steps: -- task: NuGetToolInstaller@1 - -- task: NuGetCommand@2 - inputs: - restoreSolution: '$(solution)' - -- task: DotNetCoreCLI@2 - inputs: - command: build - projects: '$(solution)' - configuration: '$(buildConfiguration)' - arguments: '--configuration $(buildConfiguration) -p:Platform="$(buildPlatform)"' - -- task: DotNetCoreCLI@2 - inputs: - command: test - projects: '$(solution)' - configuration: '$(buildConfiguration)' - arguments: '--configuration $(buildConfiguration) -p:Platform="$(buildPlatform)"' diff --git a/src/Pandas.NET/Pandas.NET.csproj b/src/Pandas.NET/Pandas.NET.csproj index 3e9fa8e..e496771 100644 --- a/src/Pandas.NET/Pandas.NET.csproj +++ b/src/Pandas.NET/Pandas.NET.csproj @@ -21,7 +21,7 @@ + - \ No newline at end of file diff --git a/test/Pandas.NET.Test/Pandas.NET.Test.csproj b/test/Pandas.NET.Test/Pandas.NET.Test.csproj index e6a0115..e4a70ac 100644 --- a/test/Pandas.NET.Test/Pandas.NET.Test.csproj +++ b/test/Pandas.NET.Test/Pandas.NET.Test.csproj @@ -13,7 +13,6 @@ all - runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/PandasConsole/DataFrames/PandasConsole.indexers.cs b/test/PandasConsole/DataFrames/PandasConsole.indexers.cs index 59a558f..95114db 100644 --- a/test/PandasConsole/DataFrames/PandasConsole.indexers.cs +++ b/test/PandasConsole/DataFrames/PandasConsole.indexers.cs @@ -18,11 +18,11 @@ public DataFrame GetSampleDataFrame() return df; } - + // index on multiple columns public (DataFrame, DataFrame) MultiColumnIndexer() { var df = GetSampleDataFrame(); return (df, df["col_1","col_2"]); } } -} \ No newline at end of file +}