Skip to content

Commit 25dcc10

Browse files
committed
ci: upload artifacts and cancel stale runs
1 parent f240e43 commit 25dcc10

File tree

8 files changed

+91
-2
lines changed

8 files changed

+91
-2
lines changed

.github/workflows/bazel.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [master]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build-and-test:
1115
runs-on: ${{ matrix.os }}
@@ -22,3 +26,11 @@ jobs:
2226
python-version: "3.12"
2327
- run: bazel build //:opencc
2428
- run: bazel test --test_output=all //src/... //data/... //test/... //python/...
29+
- name: upload artifacts
30+
if: ${{ always() }}
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: opencc-bazel-${{ matrix.os }}
34+
path: |
35+
bazel-bin/**
36+
bazel-testlogs/**

.github/workflows/check-dictionary-sorted.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
push:
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
812
sort-check:
913
runs-on: ubuntu-latest

.github/workflows/cmake.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [master]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build-and-test:
1115
runs-on: ${{ matrix.os }}
@@ -20,3 +24,12 @@ jobs:
2024
run: make test VERBOSE=1
2125
- name: make benchmark
2226
run: make benchmark VERBOSE=1
27+
- name: upload artifacts
28+
if: ${{ always() }}
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: opencc-cmake-${{ matrix.os }}
32+
path: |
33+
build/rel/**
34+
build/dbg/**
35+
build/perf/**

.github/workflows/mingw.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [master]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build:
1115
runs-on: windows-latest
@@ -30,3 +34,10 @@ jobs:
3034
run: |
3135
cd build
3236
ctest
37+
- name: upload artifacts
38+
if: ${{ always() }}
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: opencc-mingw
42+
path: |
43+
build/**

.github/workflows/msvc.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [master]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build-and-test:
1115
runs-on: windows-latest
@@ -24,3 +28,15 @@ jobs:
2428
run: ./build.cmd
2529
- name: test
2630
run: ./test.cmd
31+
- name: upload artifacts
32+
if: ${{ always() }}
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: opencc-msvc-${{ matrix.arch }}
36+
path: |
37+
bin/**
38+
lib/**
39+
share/**
40+
include/**
41+
build/ctest.log
42+
build/Testing/**

.github/workflows/nodejs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [master]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build-and-test:
1115
runs-on: ${{ matrix.os }}
@@ -29,3 +33,11 @@ jobs:
2933
node-version: ${{ matrix.node-version }}
3034
- run: npm ci
3135
- run: npm test
36+
- name: upload artifacts
37+
if: ${{ always() }}
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: opencc-nodejs-${{ matrix.os }}-node-${{ matrix.node-version }}
41+
path: |
42+
node/build/**
43+
**/npm-debug.log

.github/workflows/python.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [master]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
unit-test:
1115
runs-on: ubuntu-latest
@@ -33,7 +37,14 @@ jobs:
3337
- name: Build and install
3438
run: python -m pip install .
3539
- name: Test with pytest
36-
run: pytest python/
40+
run: pytest python/ --junitxml=pytest.xml
41+
- name: upload artifacts
42+
if: ${{ always() }}
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: opencc-python-${{ matrix.python-version }}
46+
path: |
47+
pytest.xml
3748
3849
test-pypi:
3950
strategy:
@@ -67,3 +78,10 @@ jobs:
6778
env:
6879
TWINE_USERNAME: __token__
6980
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
81+
- name: upload artifacts
82+
if: ${{ always() }}
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: opencc-pypi-${{ matrix.os }}
86+
path: |
87+
dist/**

test.cmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
cmake -S. -Bbuild -DCMAKE_INSTALL_PREFIX:PATH=. -DENABLE_GTEST:BOOL=ON -DCMAKE_BUILD_TYPE=Debug
22
cmake --build build --config Debug --target install
33
cd build
4-
ctest --verbose -C Debug
4+
ctest --verbose -C Debug > ctest.log 2>&1
5+
set TEST_ERROR=%ERRORLEVEL%
6+
type ctest.log
7+
exit /b %TEST_ERROR%

0 commit comments

Comments
 (0)