Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
Expand All @@ -22,3 +26,11 @@ jobs:
python-version: "3.12"
- run: bazel build //:opencc
- run: bazel test --test_output=all //src/... //data/... //test/... //python/...
- name: upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: opencc-bazel-${{ matrix.os }}
path: |
bazel-bin/**
bazel-testlogs/**
4 changes: 4 additions & 0 deletions .github/workflows/check-dictionary-sorted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
sort-check:
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
Expand All @@ -20,3 +24,12 @@ jobs:
run: make test VERBOSE=1
- name: make benchmark
run: make benchmark VERBOSE=1
- name: upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: opencc-cmake-${{ matrix.os }}
path: |
build/rel/**
build/dbg/**
build/perf/**
11 changes: 11 additions & 0 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
Expand All @@ -30,3 +34,10 @@ jobs:
run: |
cd build
ctest
- name: upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: opencc-mingw
path: |
build/**
16 changes: 16 additions & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: windows-latest
Expand All @@ -24,3 +28,15 @@ jobs:
run: ./build.cmd
- name: test
run: ./test.cmd
- name: upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: opencc-msvc-${{ matrix.arch }}
path: |
bin/**
lib/**
share/**
include/**
build/ctest.log
build/Testing/**
12 changes: 12 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
Expand All @@ -29,3 +33,11 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
- name: upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: opencc-nodejs-${{ matrix.os }}-node-${{ matrix.node-version }}
path: |
node/build/**
**/npm-debug.log
20 changes: 19 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
unit-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -33,7 +37,14 @@ jobs:
- name: Build and install
run: python -m pip install .
- name: Test with pytest
run: pytest python/
run: pytest python/ --junitxml=pytest.xml
- name: upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: opencc-python-${{ matrix.python-version }}
path: |
pytest.xml

test-pypi:
strategy:
Expand Down Expand Up @@ -67,3 +78,10 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- name: upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: opencc-pypi-${{ matrix.os }}
path: |
dist/**
5 changes: 4 additions & 1 deletion test.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cmake -S. -Bbuild -DCMAKE_INSTALL_PREFIX:PATH=. -DENABLE_GTEST:BOOL=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug --target install
cd build
ctest --verbose -C Debug
ctest --verbose -C Debug > ctest.log 2>&1
set TEST_ERROR=%ERRORLEVEL%
type ctest.log
exit /b %TEST_ERROR%
Loading