Skip to content

Commit 32ddbc7

Browse files
committed
Update the CI check for the English version code.
1 parent 06225a5 commit 32ddbc7

15 files changed

Lines changed: 128 additions & 51 deletions

File tree

.github/workflows/c.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ name: C
66
on:
77
push:
88
branches: ["main"]
9-
paths: ["codes/c/**/*.c", "codes/c/**/*.h"]
9+
paths:
10+
- "codes/c/**/*.c"
11+
- "codes/c/**/*.h"
12+
- "en/codes/c/**/*.c"
13+
- "en/codes/c/**/*.h"
1014
pull_request:
1115
branches: ["main"]
12-
paths: ["codes/c/**/*.c", "codes/c/**/*.h"]
16+
paths:
17+
- "codes/c/**/*.c"
18+
- "codes/c/**/*.h"
19+
- "en/codes/c/**/*.c"
20+
- "en/codes/c/**/*.h"
1321
workflow_dispatch:
1422

1523
jobs:
@@ -30,6 +38,7 @@ jobs:
3038
os: [ubuntu-latest, windows-latest]
3139
build_type: [Release]
3240
c_compiler: [gcc, clang, cl]
41+
code-dir: ["codes/c", "en/codes/c"]
3342
include:
3443
- os: windows-latest
3544
c_compiler: cl
@@ -55,18 +64,18 @@ jobs:
5564
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
5665
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
5766
run: >
58-
cmake -B ${{ github.workspace }}/codes/c/build
67+
cmake -B ${{ github.workspace }}/${{ matrix.code-dir }}/build
5968
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
6069
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
6170
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
62-
-S ${{ github.workspace }}/codes/c
71+
-S ${{ github.workspace }}/${{ matrix.code-dir }}
6372
6473
- name: Build
6574
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
66-
run: cmake --build ${{ github.workspace }}/codes/c/build --config ${{ matrix.build_type }}
75+
run: cmake --build ${{ github.workspace }}/${{ matrix.code-dir }}/build --config ${{ matrix.build_type }}
6776

6877
- name: Test
69-
working-directory: ${{ github.workspace }}/codes/c/build
78+
working-directory: ${{ github.workspace }}/${{ matrix.code-dir }}/build
7079
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
7180
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
7281
run: ctest --build-config ${{ matrix.build_type }}

.github/workflows/cpp.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ name: C++
66
on:
77
push:
88
branches: ["main"]
9-
paths: ["codes/cpp/**/*.cpp", "codes/cpp/**/*.hpp"]
9+
paths:
10+
- "codes/cpp/**/*.cpp"
11+
- "codes/cpp/**/*.hpp"
12+
- "en/codes/cpp/**/*.cpp"
13+
- "en/codes/cpp/**/*.hpp"
1014
pull_request:
1115
branches: ["main"]
12-
paths: ["codes/cpp/**/*.cpp", "codes/cpp/**/*.hpp"]
16+
paths:
17+
- "codes/cpp/**/*.cpp"
18+
- "codes/cpp/**/*.hpp"
19+
- "en/codes/cpp/**/*.cpp"
20+
- "en/codes/cpp/**/*.hpp"
1321
workflow_dispatch:
1422

1523
jobs:
@@ -30,6 +38,7 @@ jobs:
3038
os: [ubuntu-latest, windows-latest]
3139
build_type: [Release]
3240
c_compiler: [gcc, clang, cl]
41+
code-dir: ["codes/cpp", "en/codes/cpp"]
3342
include:
3443
- os: windows-latest
3544
c_compiler: cl
@@ -55,18 +64,18 @@ jobs:
5564
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
5665
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
5766
run: >
58-
cmake -B ${{ github.workspace }}/codes/cpp/build
67+
cmake -B ${{ github.workspace }}/${{ matrix.code-dir }}/build
5968
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
6069
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
6170
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
62-
-S ${{ github.workspace }}/codes/cpp
71+
-S ${{ github.workspace }}/${{ matrix.code-dir }}
6372
6473
- name: Build
6574
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
66-
run: cmake --build ${{ github.workspace }}/codes/cpp/build --config ${{ matrix.build_type }}
75+
run: cmake --build ${{ github.workspace }}/${{ matrix.code-dir }}/build --config ${{ matrix.build_type }}
6776

6877
- name: Test
69-
working-directory: ${{ github.workspace }}/codes/cpp/build
78+
working-directory: ${{ github.workspace }}/${{ matrix.code-dir }}/build
7079
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
7180
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
7281
run: ctest --build-config ${{ matrix.build_type }}

.github/workflows/dart.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ name: Dart
55
on:
66
push:
77
branches: ["main"]
8-
paths: ["codes/dart/**/*.dart"]
8+
paths:
9+
- "codes/dart/**/*.dart"
10+
- "en/codes/dart/**/*.dart"
911
pull_request:
1012
branches: ["main"]
11-
paths: ["codes/dart/**/*.dart"]
13+
paths:
14+
- "codes/dart/**/*.dart"
15+
- "en/codes/dart/**/*.dart"
1216
workflow_dispatch:
1317

1418
permissions:
@@ -22,15 +26,16 @@ jobs:
2226
matrix:
2327
os: [ubuntu-latest, macos-latest, windows-latest]
2428
dart-sdk: [stable]
29+
code-dir: ["codes/dart", "en/codes/dart"]
2530
steps:
2631
- uses: actions/checkout@v4
2732
- name: Set up Dart ${{ matrix.dart-sdk }}
2833
uses: dart-lang/setup-dart@v1
2934
with:
3035
sdk: ${{ matrix.dart-sdk}}
3136
- name: Run format
32-
run: dart format codes/dart
37+
run: dart format ${{ matrix.code-dir }}
3338
- name: Run analyze
34-
run: dart analyze codes/dart
39+
run: dart analyze ${{ matrix.code-dir }}
3540
- name: Run build
36-
run: dart codes/dart/build.dart
41+
run: dart ${{ matrix.code-dir }}/build.dart

.github/workflows/dotnet.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ name: .NET
66
on:
77
push:
88
branches: ["main"]
9-
paths: ["codes/csharp/**/*.cs"]
9+
paths:
10+
- "codes/csharp/**/*.cs"
11+
- "en/codes/csharp/**/*.cs"
1012
pull_request:
1113
branches: ["main"]
12-
paths: ["codes/csharp/**/*.cs"]
14+
paths:
15+
- "codes/csharp/**/*.cs"
16+
- "en/codes/csharp/**/*.cs"
1317
workflow_dispatch:
1418

1519
jobs:
@@ -18,11 +22,12 @@ jobs:
1822
runs-on: ${{ matrix.os }}
1923
defaults:
2024
run:
21-
working-directory: codes/csharp/
25+
working-directory: ${{ matrix.code-dir }}
2226
strategy:
2327
matrix:
2428
os: [ubuntu-latest, macos-latest, windows-latest]
2529
dotnet-version: ["8.0.x"]
30+
code-dir: ["codes/csharp", "en/codes/csharp"]
2631

2732
steps:
2833
- uses: actions/checkout@v4

.github/workflows/go.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ name: Go
33
on:
44
push:
55
branches: ["main"]
6-
paths: ["codes/go/**/*.go"]
6+
paths:
7+
- "codes/go/**/*.go"
8+
- "en/codes/go/**/*.go"
79
pull_request:
810
branches: ["main"]
9-
paths: ["codes/go/**/*.go"]
11+
paths:
12+
- "codes/go/**/*.go"
13+
- "en/codes/go/**/*.go"
1014
workflow_dispatch:
1115

1216
jobs:
@@ -15,11 +19,12 @@ jobs:
1519
runs-on: ${{ matrix.os }}
1620
defaults:
1721
run:
18-
working-directory: codes/go/
22+
working-directory: ${{ matrix.code-dir }}
1923
strategy:
2024
matrix:
2125
os: [ubuntu-latest, macos-latest, windows-latest]
2226
go-version: ["1.19.x"]
27+
code-dir: ["codes/go", "en/codes/go"]
2328

2429
steps:
2530
- uses: actions/checkout@v4

.github/workflows/java.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ name: Java
66
on:
77
push:
88
branches: ["main"]
9-
paths: ["codes/java/**/*.java"]
9+
paths:
10+
- "codes/java/**/*.java"
11+
- "en/codes/java/**/*.java"
1012
pull_request:
1113
branches: ["main"]
12-
paths: ["codes/java/**/*.java"]
14+
paths:
15+
- "codes/java/**/*.java"
16+
- "en/codes/java/**/*.java"
1317
workflow_dispatch:
1418

1519
jobs:
@@ -18,6 +22,7 @@ jobs:
1822
strategy:
1923
matrix:
2024
java: ["11", "17"]
25+
code-dir: ["codes/java", "en/codes/java"]
2126
name: Java ${{ matrix.Java }} sample
2227
steps:
2328
- uses: actions/checkout@v4
@@ -26,4 +31,4 @@ jobs:
2631
with:
2732
distribution: "temurin"
2833
java-version: ${{ matrix.java }}
29-
- run: javac -d codes/java/build codes/java/**/*.java
34+
- run: javac -d ${{ matrix.code-dir }}/build ${{ matrix.code-dir }}/**/*.java

.github/workflows/javascript.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ name: JavaScript
33
on:
44
push:
55
branches: ["main"]
6-
paths: ["codes/javascript/**/*.js"]
6+
paths:
7+
- "codes/javascript/**/*.js"
8+
- "en/codes/javascript/**/*.js"
79
pull_request:
810
branches: ["main"]
9-
paths: ["codes/javascript/**/*.js"]
11+
paths:
12+
- "codes/javascript/**/*.js"
13+
- "en/codes/javascript/**/*.js"
1014
workflow_dispatch:
1115

1216
jobs:
@@ -15,6 +19,7 @@ jobs:
1519
strategy:
1620
matrix:
1721
os: [ubuntu-latest, macos-latest, windows-latest]
22+
code-dir: ["codes/javascript", "en/codes/javascript"]
1823
steps:
1924
- uses: actions/checkout@v5
2025
- uses: actions/setup-node@v6
@@ -24,4 +29,4 @@ jobs:
2429
with:
2530
deno-version: v2.x
2631
- name: Run JavaScript Code
27-
run: deno run -A codes/javascript/test_all.js
32+
run: deno run -A ${{ matrix.code-dir }}/test_all.js

.github/workflows/kotlin.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ name: Kotlin
33
on:
44
push:
55
branches: ["main"]
6-
paths: ["codes/kotlin/**/*.kt"]
6+
paths:
7+
- "codes/kotlin/**/*.kt"
8+
- "en/codes/kotlin/**/*.kt"
79
pull_request:
810
branches: ["main"]
9-
paths: ["codes/kotlin/**/*.kt"]
11+
paths:
12+
- "codes/kotlin/**/*.kt"
13+
- "en/codes/kotlin/**/*.kt"
1014
workflow_dispatch:
1115

1216
jobs:
@@ -15,10 +19,11 @@ jobs:
1519
strategy:
1620
matrix:
1721
os: [ubuntu-latest, macos-latest]
22+
code-dir: ["codes/kotlin", "en/codes/kotlin"]
1823

1924
name: Kotlin on ${{ matrix.os }}
2025
steps:
2126
- uses: actions/checkout@v4.1.2
2227

2328
- name: Build JAR
24-
run: kotlinc codes/kotlin/**/*.kt -include-runtime -d codes/kotlin/build/test.jar
29+
run: kotlinc ${{ matrix.code-dir }}/**/*.kt -include-runtime -d ${{ matrix.code-dir }}/build/test.jar

.github/workflows/python.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ name: Python
66
on:
77
push:
88
branches: ["main"]
9-
paths: ["codes/python/**/*.py"]
9+
paths:
10+
- "codes/python/**/*.py"
11+
- "en/codes/python/**/*.py"
1012
pull_request:
1113
branches: ["main"]
12-
paths: ["codes/python/**/*.py"]
14+
paths:
15+
- "codes/python/**/*.py"
16+
- "en/codes/python/**/*.py"
1317
workflow_dispatch:
1418

1519
permissions:
@@ -23,6 +27,7 @@ jobs:
2327
matrix:
2428
os: [ubuntu-latest, macos-latest, windows-latest]
2529
python-version: ["3.10", "3.11"]
30+
code-dir: ["codes/python", "en/codes/python"]
2631
steps:
2732
- uses: actions/checkout@v4
2833
- name: Set up Python ${{ matrix.python-version }}
@@ -35,7 +40,7 @@ jobs:
3540
pip install black
3641
- name: Lint with black
3742
run: |
38-
black codes/python
43+
black ${{ matrix.code-dir }}
3944
- name: Test python code
4045
run: |
41-
python codes/python/test_all.py
46+
cd ${{ matrix.code-dir }} && python test_all.py

.github/workflows/ruby.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ name: Ruby
88
on:
99
push:
1010
branches: ["main"]
11-
paths: ["codes/ruby/**/*.rb"]
11+
paths:
12+
- "codes/ruby/**/*.rb"
13+
- "en/codes/ruby/**/*.rb"
1214
pull_request:
1315
branches: ["main"]
14-
paths: ["codes/ruby/**/*.rb"]
16+
paths:
17+
- "codes/ruby/**/*.rb"
18+
- "en/codes/ruby/**/*.rb"
1519
workflow_dispatch:
1620

1721
permissions:
@@ -25,6 +29,7 @@ jobs:
2529
matrix:
2630
os: [ubuntu-latest, macos-latest, windows-latest]
2731
ruby-version: ["3.3"]
32+
code-dir: ["codes/ruby", "en/codes/ruby"]
2833

2934
steps:
3035
- uses: actions/checkout@v4
@@ -33,4 +38,4 @@ jobs:
3338
with:
3439
ruby-version: ${{ matrix.ruby-version }}
3540
- name: Run tests
36-
run: ruby codes/ruby/test_all.rb
41+
run: ruby ${{ matrix.code-dir }}/test_all.rb

0 commit comments

Comments
 (0)