Skip to content

Commit

Permalink
T
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrohanea committed Oct 10, 2024
1 parent 35dc117 commit c6e7351
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 37 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/android-native-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ name: Android Native build

on:
workflow_dispatch:
workflow_call:


jobs:
build:

runs-on: ubuntu-20.04
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/cpu-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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: CI (Native + dotnet)

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
android:
uses: ./android-native-build.yml

macos:
uses: ./macos-native-build.yml

windows:
uses: ./windows-native-build.yml

wasm:
uses: ./wasm-native-build.yml

linux:
uses: ./linux-native-build.yml

dotnet-build:
needs:
- android
- macos
- windows
- wasm
- linux
uses: ./dotnet.yml

47 changes: 34 additions & 13 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:

jobs:
build:
dotnet-windows:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand All @@ -28,17 +23,15 @@ jobs:
id: download-artifact
uses: actions/download-artifact@v4
with:
name: wasm-build
merge-multiple: true

- name: Install Java
if: runner.os == 'Windows'
uses: actions/setup-java@v2
with:
distribution: 'microsoft'
java-version: '11'

- name: Install .NET Workloads
if: runner.os == 'Windows'
run: |
dotnet workload install android --ignore-failed-sources
dotnet workload install ios --ignore-failed-sources
Expand All @@ -47,8 +40,36 @@ jobs:
- name: Restore dependencies
run: dotnet restore ./Whisper.net.sln

- name: Build
run: dotnet build ./Whisper.net.sln --no-restore -warnaserror
run: dotnet build ./Whisper.net.sln --no-restore -warnaserror

- name: Test
run: |
dotnet test ./Whisper.net.sln --no-build
dotnet-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Download Artifacts
id: download-artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Restore dependencies
run: dotnet restore ./Whisper.net.sln

- name: Build
run: dotnet build ./Whisper.net.sln --no-restore -warnaserror

- name: Test
run: |
dotnet test ./Whisper.net.sln --no-build
2 changes: 0 additions & 2 deletions .github/workflows/linux-cuda-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
build:

runs-on: ubuntu-20.04
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linux-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ name: Linux Native build

on:
workflow_dispatch:
workflow_call:


jobs:
build:

runs-on: ubuntu-20.04
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/linux-openvino-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
build:

runs-on: ubuntu-20.04
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/macos-native-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ name: MacOs Native build

on:
workflow_dispatch:
workflow_call:


jobs:
intel-build:
runs-on: macos-13
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand All @@ -32,7 +31,6 @@ jobs:
Whisper.net.Run*/*.metal
arm-build:
needs: intel-build
runs-on: macos-14
permissions:
contents: write
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/wasm-native-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ name: Wasm Native build

on:
workflow_dispatch:
workflow_call:

jobs:
build:

runs-on: ubuntu-20.04
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/windows-arm-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
build:

runs-on: windows-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/windows-cuda-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
build:

runs-on: windows-2019
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/windows-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ name: Windows native build

on:
workflow_dispatch:
workflow_call:


jobs:
build:
intel-build:

runs-on: windows-2019
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand All @@ -32,3 +31,30 @@ jobs:
with:
name: windows-build
path: 'Whisper.net.Run*/win-*/*'

arm-build:

runs-on: windows-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Run Build
run: |
Import-Module ./windows-scripts.ps1
BuildWindowsArm
shell: pwsh

- name: Upload Windows Build Artifacts
uses: actions/upload-artifact@v3
with:
name: windows-arm-build
path: 'Whisper.net.Run*/win-*/*'
2 changes: 0 additions & 2 deletions .github/workflows/windows-openvino-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
build:

runs-on: windows-2022
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/windows-vulkan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
build:

runs-on: windows-2022
permissions:
contents: write

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions Whisper.net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{5C865649-4AED-4BBF-A7CA-BD68D21EF48F}"
ProjectSection(SolutionItems) = preProject
.github\workflows\android-native-build.yaml = .github\workflows\android-native-build.yaml
.github\workflows\cpu-build-and-test.yml = .github\workflows\cpu-build-and-test.yml
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\linux-cuda-native-build.yml = .github\workflows\linux-cuda-native-build.yml
.github\workflows\linux-native-build.yml = .github\workflows\linux-native-build.yml
Expand Down

0 comments on commit c6e7351

Please sign in to comment.