Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-platform support #16

Merged
merged 220 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
2d19cca
CLD3: try to build for Windows
gluschenko Sep 21, 2024
3996476
Update run-build.sh
gluschenko Sep 21, 2024
2c05af5
Update LanguageIdentification.CLD3.Native.csproj
gluschenko Sep 21, 2024
40f5012
Add Windows in library logic
gluschenko Sep 21, 2024
919d76a
Update CMakeLists.txt
gluschenko Sep 22, 2024
156113b
Update CMakeLists.txt
gluschenko Sep 22, 2024
5ec5361
Update CMakeLists.txt
gluschenko Sep 22, 2024
83e073a
Update CMakeLists.txt
gluschenko Sep 22, 2024
03c7f82
Update CMakeLists.txt
gluschenko Sep 22, 2024
3d2f098
Update toolchain-mingw.cmake
gluschenko Sep 22, 2024
4f23a6e
CLD3: native naming changes
gluschenko Sep 22, 2024
dbfa20e
CLD3: fix EXPORT macros
gluschenko Sep 22, 2024
115bb2a
CLD3: try to fix linking for Windows
gluschenko Sep 22, 2024
a31d83a
Revert "CLD3: fix EXPORT macros"
gluschenko Sep 22, 2024
069230f
Update binding.cc
gluschenko Sep 22, 2024
421caa2
Revert "Update binding.cc"
gluschenko Sep 22, 2024
cd31cc0
Update github-ci.yml
gluschenko Sep 22, 2024
45ff220
Update github-ci.yml
gluschenko Sep 22, 2024
c27559f
Update github-ci.yml
gluschenko Sep 22, 2024
0b2961b
Update github-ci.yml
gluschenko Sep 22, 2024
8e635d6
Update github-ci.yml
gluschenko Sep 22, 2024
8884eb1
Cross-platform tests: skip if not supported
gluschenko Sep 22, 2024
dc536d2
Update LinguaDetectorBuilder.cs
gluschenko Sep 22, 2024
b0d4223
Update github-ci.yml
gluschenko Sep 22, 2024
b5bf5e6
Cross-platform tests: skip if not supported
gluschenko Sep 22, 2024
e559565
Update LinguaDetectorBuilder.cs
gluschenko Sep 22, 2024
e976669
0.0.0.21 -> 0.0.0.22
gluschenko Sep 22, 2024
2b4d2b9
Merge branch 'skip-tests' into cross-platform
gluschenko Sep 22, 2024
78f3330
GitHub CI: add tests for MacOS
gluschenko Sep 23, 2024
3e744d5
CLD2: add support for Windows
gluschenko Sep 23, 2024
dae06fc
Update MainTests.cs
gluschenko Sep 23, 2024
67be82f
FastText: try to build for Windows
gluschenko Sep 23, 2024
ae86f83
Update github-ci.yml
gluschenko Sep 23, 2024
62d9245
Update CMakeLists.txt
gluschenko Sep 23, 2024
e98e426
Update CMakeLists.txt
gluschenko Sep 23, 2024
2abc33a
Update CMakeLists.txt
gluschenko Sep 23, 2024
a65c508
FT: try to use wine
gluschenko Sep 25, 2024
d501a0a
Update setup-build.sh
gluschenko Sep 25, 2024
10aba40
CI: try to build images
gluschenko Sep 25, 2024
633f2c8
Update github-ci.yml
gluschenko Sep 25, 2024
88354bd
Update github-ci.yml
gluschenko Sep 25, 2024
a59d035
Update github-ci.yml
gluschenko Sep 25, 2024
fde24bc
Update github-ci.yml
gluschenko Sep 25, 2024
dc1a4a2
Update github-ci.yml
gluschenko Sep 25, 2024
c814578
Update github-ci.yml
gluschenko Sep 25, 2024
0cd74f4
Update github-ci.yml
gluschenko Sep 25, 2024
8125fb5
Update github-ci.yml
gluschenko Sep 25, 2024
b8fe8b9
Update github-ci.yml
gluschenko Sep 25, 2024
ce9f8b2
Update github-ci.yml
gluschenko Sep 25, 2024
faeab93
Update github-ci.yml
gluschenko Sep 25, 2024
6d26274
Update github-ci.yml
gluschenko Sep 25, 2024
91a4e15
Update github-ci.yml
gluschenko Sep 25, 2024
bd30331
Update github-ci.yml
gluschenko Sep 25, 2024
88a94d7
Update github-ci.yml
gluschenko Sep 25, 2024
1a45924
Update github-ci.yml
gluschenko Sep 25, 2024
948e8c8
Update github-ci.yml
gluschenko Sep 25, 2024
9bf9a6f
Different platforms for different models
gluschenko Sep 27, 2024
8d77bec
Update github-ci.yml
gluschenko Sep 27, 2024
b9a1810
Update github-ci.yml
gluschenko Sep 27, 2024
a91ace5
Update github-ci.yml
gluschenko Sep 27, 2024
8d98df6
FT: fix build for Windows
gluschenko Sep 28, 2024
250c9c2
CLD2, CLD3, FT: enforce using UTF8
gluschenko Sep 30, 2024
0fad2fb
Update CMakeLists.txt
gluschenko Sep 30, 2024
e9a0e03
CI: remove "build-docker-images" stage
gluschenko Sep 30, 2024
2f2b6e0
CI: remove custom code for FT
gluschenko Sep 30, 2024
a579a1a
Update binding.cc
gluschenko Sep 30, 2024
e61a077
Update binding.cc
gluschenko Sep 30, 2024
5f892fe
Update binding.cc
gluschenko Sep 30, 2024
8d2f028
Update github-ci.yml
gluschenko Sep 30, 2024
c1ca6fd
Update binding.cc
gluschenko Sep 30, 2024
ebb55c3
CLD3: change cld3_find_language return type
gluschenko Sep 30, 2024
4f5d1b8
CLD2: fix test
gluschenko Sep 30, 2024
f2d2d98
FT: Try to build in Windows environment
gluschenko Sep 30, 2024
7168525
Update run-build.ps1
gluschenko Sep 30, 2024
2127bca
Update run-build.ps1
gluschenko Sep 30, 2024
4a0db84
Update run-build.ps1
gluschenko Sep 30, 2024
b1f135a
Update run-build.ps1
gluschenko Sep 30, 2024
4701bef
FT: WIndows build fixes + MacOS support for fun
gluschenko Sep 30, 2024
ec296f0
FT: try to fix build-native stage + artifact upload
gluschenko Oct 1, 2024
9831062
Update github-ci.yml
gluschenko Oct 1, 2024
6f2ed01
Update github-ci.yml
gluschenko Oct 1, 2024
e03748b
TF: Download artifact in "build-nugets" stage
gluschenko Oct 1, 2024
addb3a2
Update github-ci.yml
gluschenko Oct 1, 2024
1be36b8
Update github-ci.yml
gluschenko Oct 1, 2024
f4d7d67
FT: download pretrained models for win & mac tests
gluschenko Oct 1, 2024
4daa82a
Update github-ci.yml
gluschenko Oct 1, 2024
f34a976
Update github-ci.yml
gluschenko Oct 1, 2024
1cdba8d
FT: try to fix build for MacOS
gluschenko Oct 1, 2024
21b29fa
Update github-ci.yml
gluschenko Oct 1, 2024
3c1e101
Update github-ci.yml
gluschenko Oct 1, 2024
a091713
Update github-ci.yml
gluschenko Oct 1, 2024
8ce9640
Update github-ci.yml
gluschenko Oct 1, 2024
9faf7da
Update github-ci.yml
gluschenko Oct 1, 2024
0e59a6a
Update github-ci.yml
gluschenko Oct 1, 2024
609865f
FT: fix MacOS build (-static-libgcc remove)
gluschenko Oct 1, 2024
7e91c4f
FT: add MacOS support
gluschenko Oct 1, 2024
451acec
Update CMakeLists.txt
gluschenko Oct 1, 2024
7cfb73a
Update CMakeLists.txt
gluschenko Oct 1, 2024
e1a18c6
Update CMakeLists.txt
gluschenko Oct 1, 2024
b88b857
FT: /usr/lib/libc++.a
gluschenko Oct 1, 2024
64e75ae
Update CMakeLists.txt
gluschenko Oct 1, 2024
81ee3b3
Update CMakeLists.txt
gluschenko Oct 1, 2024
8142a67
Update github-ci.yml
gluschenko Oct 1, 2024
35187de
Update CMakeLists.txt
gluschenko Oct 1, 2024
d6e5e0f
Update github-ci.yml
gluschenko Oct 2, 2024
1e09a1b
Update github-ci.yml
gluschenko Oct 2, 2024
4274abb
FT: brew install llvm
gluschenko Oct 2, 2024
10f68ac
FT: /opt/homebrew/opt/llvm/bin
gluschenko Oct 2, 2024
6943ec3
FT: /opt/homebrew/opt/llvm/lib
gluschenko Oct 2, 2024
590812a
Update github-ci.yml
gluschenko Oct 2, 2024
acb10d0
Update github-ci.yml
gluschenko Oct 2, 2024
47f42fc
Update github-ci.yml
gluschenko Oct 2, 2024
84aedac
Update CMakeLists.txt
gluschenko Oct 2, 2024
8632261
FT: brew install llvm
gluschenko Oct 2, 2024
fbcef30
Update CMakeLists.txt
gluschenko Oct 2, 2024
5226ff3
Update CMakeLists.txt
gluschenko Oct 2, 2024
a586475
Update github-ci.yml
gluschenko Oct 2, 2024
fff2194
Revert "Update CMakeLists.txt"
gluschenko Oct 2, 2024
fcdc337
Update github-ci.yml
gluschenko Oct 2, 2024
ad43ccc
Update github-ci.yml
gluschenko Oct 2, 2024
527358e
MacOS: amd vs x86
gluschenko Oct 2, 2024
3788d0f
Update CMakeLists.txt
gluschenko Oct 2, 2024
931acad
Update CMakeLists.txt
gluschenko Oct 2, 2024
1902921
Update run-build.macos.sh
gluschenko Oct 2, 2024
585cf5f
MacOS: more flags
gluschenko Oct 2, 2024
0615edf
Update CMakeLists.txt
gluschenko Oct 2, 2024
658c46b
Update CMakeLists.txt
gluschenko Oct 2, 2024
035540b
Update CMakeLists.txt
gluschenko Oct 2, 2024
d8ef35b
Update run-build.macos.sh
gluschenko Oct 2, 2024
f246ba1
Update CMakeLists.txt
gluschenko Oct 2, 2024
3c57402
Update run-build.macos.sh
gluschenko Oct 2, 2024
665b724
Update run-build.macos.sh
gluschenko Oct 2, 2024
adca952
Update run-build.macos.sh
gluschenko Oct 2, 2024
751883c
Update run-build.macos.sh
gluschenko Oct 2, 2024
00a6832
MacOS: build split for each arch
gluschenko Oct 2, 2024
8e999a1
MacOS: arch as argument
gluschenko Oct 2, 2024
b51853e
Update LanguageIdentification.FastText.Native.csproj
gluschenko Oct 2, 2024
fac901a
Update github-ci.yml
gluschenko Oct 2, 2024
deaead1
Update CMakeLists.txt
gluschenko Oct 2, 2024
3bc8f3e
Update run-build.macos.sh
gluschenko Oct 2, 2024
47d1009
Update github-ci.yml
gluschenko Oct 2, 2024
9342f40
MasOS: pipeline fixes + IsSupported() unification
gluschenko Oct 2, 2024
494bb9e
MacOS: cross-arch naming of libfasttext.dylib
gluschenko Oct 2, 2024
0bdb64b
MasOS: specific model path
gluschenko Oct 2, 2024
7585c56
MacOS: another try to fix paths to models
gluschenko Oct 2, 2024
3150155
Update github-ci.yml
gluschenko Oct 2, 2024
028915f
Update FastTextDetector.cs
gluschenko Oct 2, 2024
d25378b
Update FastTextDetector.cs
gluschenko Oct 3, 2024
5395b6d
0.0.0.22 -> 0.0.1
gluschenko Oct 3, 2024
ad63ed5
Running tests outside of Docker
gluschenko Oct 3, 2024
58128bf
Update MainTests.cs
gluschenko Oct 3, 2024
c8bc800
CI fixes
gluschenko Oct 3, 2024
a400307
FT + MediaPipe: preload models from code
gluschenko Oct 3, 2024
4f00863
Update Dockerfiles
gluschenko Oct 3, 2024
e949514
Test
gluschenko Oct 3, 2024
721c828
Update FastTextTests.cs
gluschenko Oct 3, 2024
ec68800
Fixes
gluschenko Oct 3, 2024
c7f527a
Update github-ci.yml
gluschenko Oct 3, 2024
c86a59a
New test stage
gluschenko Oct 3, 2024
fbcb1ea
Tests: add CheckPackageVersion
gluschenko Oct 3, 2024
4e68dcd
Fix CheckPackageVersion
gluschenko Oct 3, 2024
490bf15
Fix version parsing
gluschenko Oct 3, 2024
10868fb
Update github-ci.yml
gluschenko Oct 4, 2024
b6b26cb
Update CMakeLists.txt
gluschenko Oct 4, 2024
11ccaf0
CLD2 + CLD3 + FT: unification of CMakeLists.txt
gluschenko Oct 4, 2024
a8a823f
CLD2 + FT: no static linking on Linux
gluschenko Oct 4, 2024
a99bc86
CLD2 + CLD3
gluschenko Oct 4, 2024
e065849
Update README.md
gluschenko Oct 5, 2024
34a5438
Try to use static linking for CLD2 + CLD3
gluschenko Oct 5, 2024
993b6f0
CLD2 + CLD3: Build fixes
gluschenko Oct 5, 2024
8789222
CLD2 + CLD3: fixes
gluschenko Oct 5, 2024
71c7202
CLD2 + CLD3: yet another build fixes
gluschenko Oct 5, 2024
c75a237
CLD2 + CLD3: -Wno-narrowing everywhere
gluschenko Oct 5, 2024
4e5965a
CLD2 + CLD3: try to build for MacOS
gluschenko Oct 5, 2024
83ed53a
CLD2 + CLD3: fixe MacOS build
gluschenko Oct 5, 2024
5b31879
CLD2 + CLD3: fix stupid mistakes
gluschenko Oct 5, 2024
ecacdcf
Update CMakeLists.txt
gluschenko Oct 5, 2024
af25730
CLD2 + CLD3 + FT: try to use '-static'
gluschenko Oct 5, 2024
a6504ce
Using debian:bullseye-slim
gluschenko Oct 5, 2024
041a3a3
CLD2 + CLD3 + FT: no static libs for Linux
gluschenko Oct 5, 2024
289c45e
Update setup-build.sh
gluschenko Oct 5, 2024
2293703
debian:bullseye-slim -> debian:bookworm-slim
gluschenko Oct 5, 2024
b59fbca
Update setup-build.sh
gluschenko Oct 5, 2024
bc8ce60
Update setup-build.sh
gluschenko Oct 5, 2024
9c034fb
Update setup-build.sh
gluschenko Oct 5, 2024
6239594
CLD2 + CLD3: turn on MacOS support in packages
gluschenko Oct 5, 2024
98330a3
Update setup-build.sh
gluschenko Oct 5, 2024
c7fb8f1
Update setup-build.sh
gluschenko Oct 5, 2024
073a498
Update setup-build.sh
gluschenko Oct 5, 2024
12a8cff
Update setup-build.sh
gluschenko Oct 5, 2024
2500b7a
Update setup-build.sh
gluschenko Oct 5, 2024
e28d311
Update run-build.sh
gluschenko Oct 5, 2024
43b78d8
Update setup-build.sh
gluschenko Oct 6, 2024
f7750bd
Move zx to run-build
gluschenko Oct 6, 2024
0c5af62
Update Dockerfile
gluschenko Oct 6, 2024
9eacefe
Fixes
gluschenko Oct 6, 2024
20288be
Install NPM in run-build.sh
gluschenko Oct 6, 2024
fe7e9ac
Update Dockerfile
gluschenko Oct 6, 2024
8348b29
Update run-build.sh
gluschenko Oct 6, 2024
2b64080
Try to fix build for MacOS
gluschenko Oct 6, 2024
c9d9248
Update CLD2Detector.cs
gluschenko Oct 6, 2024
b69cb9f
test
gluschenko Oct 6, 2024
70d380e
Update CLD2Detector.cs
gluschenko Oct 6, 2024
50c3950
CLD2 + CLD3: using DLLEXPORT
gluschenko Oct 6, 2024
677b069
CLD3 for Mac is on
gluschenko Oct 6, 2024
9647196
CLD2 for Mac is on
gluschenko Oct 6, 2024
4434023
FT: __attribute__((visibility("default")))
gluschenko Oct 6, 2024
817f0c8
CLD3: __attribute__((visibility("default")))
gluschenko Oct 6, 2024
84c9219
CLD2: __attribute__((visibility("default")))
gluschenko Oct 6, 2024
1adb77b
Update CMakeLists.txt
gluschenko Oct 6, 2024
f0bed9a
Update CMakeLists.txt
gluschenko Oct 6, 2024
305d48a
Update CLD2Detector.cs
gluschenko Oct 6, 2024
2b10621
Update CLD3Detector.cs
gluschenko Oct 6, 2024
829d7aa
Update CLD2Detector.cs
gluschenko Oct 6, 2024
3796812
debian:bookworm-slim -> debian:bullseye-slim
gluschenko Oct 6, 2024
e97ef6a
Fix
gluschenko Oct 6, 2024
882477b
Update github-ci.yml
gluschenko Oct 6, 2024
cc341a7
ubuntu:20.04 -> ubuntu:22.04
gluschenko Oct 6, 2024
cf1003d
Update github-ci.yml
gluschenko Oct 6, 2024
8dd5464
Bump versions and update readme
gluschenko Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 129 additions & 39 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ on:
workflow_dispatch:

jobs:
build-nugets:
name: 🚀 Pack ${{matrix.projectName}}
runs-on: ubuntu-latest
build-native:
name: 💾 Build ${{matrix.task.title}} for ${{matrix.task.os}} (${{matrix.task.arch}})
runs-on: ${{matrix.task.os}}
strategy:
fail-fast: false
matrix:
projectName:
- LanguageIdentification.CLD2
- LanguageIdentification.CLD3
- LanguageIdentification.FastText
- LanguageIdentification.Whatlang
- LanguageIdentification.MediaPipe
- LanguageIdentification.Lingua
- LanguageCode
task:
- { title: FastText, projectName: LanguageIdentification.FastText.Native, os: windows-latest, arch: x86_64, script: ./Scripts/run-build.ps1, artifact: fasttext.dll }
- { title: FastText, projectName: LanguageIdentification.FastText.Native, os: macos-13, arch: x86_64, script: ./Scripts/run-build.macos.sh, artifact: libfasttext.x86_64.dylib }
- { title: FastText, projectName: LanguageIdentification.FastText.Native, os: macos-14, arch: arm64, script: ./Scripts/run-build.macos.sh, artifact: libfasttext.arm64.dylib }
- { title: CLD2, projectName: LanguageIdentification.CLD2.Native, os: macos-13, arch: x86_64, script: ./Scripts/run-build.macos.sh, artifact: libcld2.x86_64.dylib }
- { title: CLD2, projectName: LanguageIdentification.CLD2.Native, os: macos-14, arch: arm64, script: ./Scripts/run-build.macos.sh, artifact: libcld2.arm64.dylib }
- { title: CLD3, projectName: LanguageIdentification.CLD3.Native, os: macos-13, arch: x86_64, script: ./Scripts/run-build.macos.sh, artifact: libcld3.x86_64.dylib }
- { title: CLD3, projectName: LanguageIdentification.CLD3.Native, os: macos-14, arch: arm64, script: ./Scripts/run-build.macos.sh, artifact: libcld3.arm64.dylib }
permissions:
contents: read
packages: write
Expand All @@ -38,14 +38,79 @@ jobs:
with:
filters: |
src:
- '${{env.ROOT}}/${{matrix.projectName}}/**'
- '${{env.ROOT}}/${{matrix.task.projectName}}/**'

- uses: dorny/paths-filter@v3
id: changes-native
with:
filters: |
src:
- '${{env.ROOT}}/${{matrix.task.projectName}}.Native/**'

- name: 🚀 Build ${{matrix.task.projectName}}
if: steps.changes.outputs.src == 'true'
working-directory: ${{env.ROOT}}/${{matrix.task.projectName}}
run: |
echo $(pwd)
git update-index --chmod=+x ${{matrix.task.script}}
chmod +x ${{matrix.task.script}}
${{matrix.task.script}} ${{matrix.task.arch}}

- uses: actions/upload-artifact@v4
if: steps.changes.outputs.src == 'true'
with:
name: native-${{matrix.task.projectName}}-${{matrix.task.os}}
path: ${{env.ROOT}}/${{matrix.task.projectName}}/${{matrix.task.artifact}}
retention-days: 1
overwrite: 'true'
compression-level: 0
if-no-files-found: 'error'

build-package:
name: 🚀 Pack ${{matrix.task.title}}
runs-on: ${{matrix.task.os}}
needs: build-native
strategy:
fail-fast: false
matrix:
task:
- { title: CLD2, projectName: LanguageIdentification.CLD2, os: ubuntu-latest }
- { title: CLD3, projectName: LanguageIdentification.CLD3, os: ubuntu-latest }
- { title: FastText, projectName: LanguageIdentification.FastText, os: ubuntu-latest }
- { title: Whatlang, projectName: LanguageIdentification.Whatlang, os: ubuntu-latest }
- { title: MediaPipe, projectName: LanguageIdentification.MediaPipe, os: ubuntu-latest }
- { title: Lingua, projectName: LanguageIdentification.Lingua, os: ubuntu-latest }
- { title: LanguageCode, projectName: LanguageCode, os: ubuntu-latest }
permissions:
contents: read
packages: write
env:
ROOT: ./src
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'

- uses: actions/download-artifact@v4
with:
pattern: native-${{matrix.task.projectName}}.Native-*
merge-multiple: true
path: ${{env.ROOT}}/${{matrix.task.projectName}}.Native/

- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- '${{env.ROOT}}/${{matrix.task.projectName}}/**'

- uses: dorny/paths-filter@v3
id: changes-native
with:
filters: |
src:
- '${{env.ROOT}}/${{matrix.projectName}}.Native/**'
- '${{env.ROOT}}/${{matrix.task.projectName}}.Native/**'

- name: 📂 Setup .NET Core
uses: actions/setup-dotnet@v4
Expand All @@ -57,38 +122,51 @@ jobs:
8.0.x
source-url: https://nuget.pkg.github.com/${{github.repository_owner}}/index.json

- name: 🚀 Pack ${{matrix.projectName}}.Native
- name: 🚀 Pack ${{matrix.task.projectName}}.Native
if: steps.changes-native.outputs.src == 'true'
working-directory: ${{env.ROOT}}/${{matrix.projectName}}.Native
working-directory: ${{env.ROOT}}/${{matrix.task.projectName}}.Native
run: dotnet pack -c Release -o out

- name: 🚀 Pack ${{matrix.projectName}}
- name: 🚀 Pack ${{matrix.task.projectName}}
if: steps.changes.outputs.src == 'true'
working-directory: ${{env.ROOT}}/${{matrix.projectName}}
working-directory: ${{env.ROOT}}/${{matrix.task.projectName}}
run: dotnet pack -c Release -o out

- uses: actions/upload-artifact@v4
if: steps.changes-native.outputs.src == 'true'
with:
name: build-${{matrix.projectName}}.Native
path: ${{env.ROOT}}/${{matrix.projectName}}.Native/out
name: build-${{matrix.task.projectName}}.Native
path: ${{env.ROOT}}/${{matrix.task.projectName}}.Native/out
retention-days: 1
overwrite: 'true'
compression-level: 0

- uses: actions/upload-artifact@v4
if: steps.changes.outputs.src == 'true'
with:
name: build-${{matrix.projectName}}
path: ${{env.ROOT}}/${{matrix.projectName}}/out
name: build-${{matrix.task.projectName}}
path: ${{env.ROOT}}/${{matrix.task.projectName}}/out
retention-days: 1
overwrite: 'true'
compression-level: 0

test-nugets:
name: 🧪 Test ${{matrix.projectName}}
runs-on: ubuntu-latest
needs: build-nugets
test-package:
name: 🧪 Test on ${{matrix.task.os}}
runs-on: ${{matrix.task.os}}
needs: build-package
strategy:
fail-fast: false
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#standard-github-hosted-runners-for--private-repositories
matrix:
task:
- { os: ubuntu-24.04 }
- { os: ubuntu-22.04 }
# - { os: ubuntu-20.04 }
- { os: windows-2022 }
- { os: windows-2019 }
- { os: macos-13 }
- { os: macos-14 }
- { os: macos-15 }
permissions:
contents: read
packages: write
Expand All @@ -100,36 +178,48 @@ jobs:

- name: 📂 Files
working-directory: ${{env.ROOT}}
run: mkdir -p local-nugets
run: mkdir -p local-packages

- uses: actions/download-artifact@v4
with:
pattern: build-*
merge-multiple: true
path: ${{env.ROOT}}/local-nugets
path: ${{env.ROOT}}/local-packages

- name: 📂 Files
working-directory: ${{env.ROOT}}
working-directory: ${{env.ROOT}}/local-packages
run: ls -R

- name: 📂 Build Docker Image
working-directory: ${{env.ROOT}}
- name: 📂 Use local NuGet (Linux)
if: ${{ startsWith(matrix.task.os, 'ubuntu') }}
run: |
docker build -f ./test.Dockerfile -t langunage-identification-test-runner:latest .
docker build -f ./test-ci.Dockerfile -t langunage-identification-test-runner-ci:latest .
path=$(realpath "${{env.ROOT}}/local-packages")
dotnet nuget add source $path

- name: 🧪 Run Tests in Docker
working-directory: ${{env.ROOT}}
run: docker run --rm -v $(pwd):/src langunage-identification-test-runner-ci:latest
- name: 📂 Use local NuGet (Windows)
if: ${{ startsWith(matrix.task.os, 'windows') }}
run: |
$path = [System.IO.Path]::GetFullPath('${{env.ROOT}}/local-packages')
dotnet nuget add source $path

- name: 🧪 Run Test for LanguageCode
working-directory: ${{env.ROOT}}/LanguageCode.Tests
- name: 📂 Use local NuGet (OSX)
if: ${{ startsWith(matrix.task.os, 'macos') }}
run: |
path=$(realpath "${{env.ROOT}}/local-packages")
dotnet nuget add source $path

- name: 🧪 Run Tests for LanguageIdentification
working-directory: ${{env.ROOT}}/LanguageIdentification.Tests
run: dotnet test -c CI

deploy-nugets:
- name: 🧪 Run Tests for LanguageCode
working-directory: ${{env.ROOT}}/LanguageCode.Tests
run: dotnet test

deploy-package:
name: 🚚 Push ${{matrix.projectName}}
runs-on: ubuntu-latest
needs: test-nugets
needs: test-package
if: github.ref == 'refs/heads/master'
strategy:
fail-fast: false
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ functionality into their applications.

## Platform support

| Model | Linux | Windows | macOS | Blazor WASM |
| :-------- | :----------------: | :--------------: | :----: | :------------: |
| CLD2 | :white_check_mark: | :construction: | :x: | :x: |
| CLD3 | :white_check_mark: | :construction: | :x: | :x: |
| FastText | :white_check_mark: | :construction: | :x: | :x: |
| Whatlang | :white_check_mark: | :construction: | :x: | :x: |
| MediaPipe | :white_check_mark: | :construction: | :x: | :x: |
| Lingua | :white_check_mark: | :construction: | :x: | :x: |
| Model | Linux | Windows | macOS | Blazor WASM |
| :-------- | :----------------: | :----------------: | :----------------: | :------------: |
| CLD2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
| CLD3 | :white_check_mark: | :white_check_mark: | :construction: | :x: |
| FastText | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
| Whatlang | :white_check_mark: | :construction: | :construction: | :x: |
| MediaPipe | :white_check_mark: | :construction: | :construction: | :x: |
| Lingua | :white_check_mark: | :construction: | :construction: | :x: |

:white_check_mark: — Full support |
:x: — No support |
Expand Down
4 changes: 2 additions & 2 deletions README_CLD2.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Welcome to **Panlingo.LanguageIdentification.CLD2**, a .NET wrapper for the Chro
## Requirements

- Runtime: **.NET >= 5.0**
- OS: **Linux**
- Arch: **AMD64**
- OS: **Linux (Ubuntu, Debian)**, **Windows 10+** or **Windows Server 2019+**, **macOS**
- Arch: **AMD64** (or **ARM** for macOS)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion README_CLD3.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Welcome to **Panlingo.LanguageIdentification.CLD3**, a .NET wrapper for the Chro
## Requirements

- Runtime: **.NET >= 5.0**
- OS: **Linux**
- OS: **Linux (Ubuntu, Debian)**, **Windows 10+** or **Windows Server 2019+**
- Arch: **AMD64**

## Installation
Expand Down
4 changes: 2 additions & 2 deletions README_FASTTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Welcome to **Panlingo.LanguageIdentification.FastText**, a .NET wrapper for the
## Requirements

- Runtime: **.NET >= 5.0**
- OS: **Linux**
- Arch: **AMD64**
- OS: **Linux (Ubuntu, Debian)**, **Windows 10+** or **Windows Server 2019+**, **macOS**
- Arch: **AMD64** (or **ARM** for macOS)

## Installation

Expand Down
4 changes: 4 additions & 0 deletions src/LanguageCode.Tests/LanguageCode.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

<RootNamespace>Panlingo.LanguageCode.Tests</RootNamespace>

<Configurations>Debug;Release;CI</Configurations>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/LanguageCode.Tests/LanguageCodeTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Panlingo.LanguageCode;
using Panlingo.LanguageCode.Models;
using Panlingo.LanguageCode.Models;

namespace LanguageCode.Tests
namespace Panlingo.LanguageCode.Tests
{
public class LanguageCodeTests
{
Expand Down
2 changes: 1 addition & 1 deletion src/LanguageCode/LanguageCode.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Version>0.0.0.21</Version>
<Version>0.0.0.23</Version>
<PackageId>Panlingo.LanguageCode</PackageId>
<AssemblyName>Panlingo.LanguageCode</AssemblyName>
<RootNamespace>Panlingo.LanguageCode</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/LanguageIdentification.CLD2.ConsoleTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ static void Main(string[] args)
{
using var cld2 = new CLD2Detector();

var text = "Hello, how are you? Привіт, як справи? Привет, как дела?";
var text = "Привіт, як справи?";

var predictions = cld2.PredictLanguage(text);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"profiles": {
"Docker": {
"commandName": "Docker"
},
"WSL": {
"commandName": "WSL2",
"distributionName": ""
},
"Project": {
"commandName": "Project"
}
}
}
1 change: 1 addition & 0 deletions src/LanguageIdentification.CLD2.Native/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
libcld2.so
libcld2.dll
build_temp/**
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ public static class CLD2NativeLibrary
/// <summary>
/// Name of native binary
/// </summary>
public const string Name = "libcld2.so";
public const string Name = "libcld2";
}
}
3 changes: 1 addition & 2 deletions src/LanguageIdentification.CLD2.Native/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
FROM debian:bullseye-slim AS build

WORKDIR /repo
COPY ["src/LanguageIdentification.CLD2.Native/LanguageIdentification.CLD2.Native.csproj", "src/LanguageIdentification.CLD2.Native/"]
Expand Down
Loading