Skip to content

Commit 21823e4

Browse files
committed
update ci & fixes for dependency changes
1 parent e1ebc2e commit 21823e4

8 files changed

Lines changed: 84 additions & 51 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: windows & linux
1+
name: Windows & Ubuntu & macOS x86_64
22
on:
33
pull_request:
44
branches: [ main ]
55
workflow_dispatch:
66

77
jobs:
8-
build:
8+
build-ubuntu:
99
name: Linux ${{ matrix.target }}
1010
runs-on: ubuntu-latest
1111
strategy:
@@ -14,6 +14,8 @@ jobs:
1414
include:
1515
- target: amd64
1616
flags: -m64
17+
- target: x86
18+
flags: -m32
1719
steps:
1820
- uses: actions/checkout@v4
1921
- name: Prepare
@@ -27,14 +29,14 @@ jobs:
2729
cd build
2830
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DCMAKE_C_FLAGS=${{ matrix.flags }} ..
2931
cmake --build .
30-
- name: Run test examples
32+
- name: Run tests
3133
run: |
3234
cd build
3335
ctest -C Debug --output-on-failure -F
3436
3537
build-windows:
3638
name: Windows (${{ matrix.arch }})
37-
runs-on: windows-latest
39+
runs-on: windows-2022
3840
strategy:
3941
fail-fast: false
4042
matrix:
@@ -50,8 +52,24 @@ jobs:
5052
cd build
5153
cmake .. -DBUILD_TESTS=ON -A ${{ matrix.arch }}
5254
cmake --build . --config Debug
53-
- name: Run test examples
55+
- name: Run tests
5456
shell: cmd
5557
run: |
5658
cd build
5759
ctest -C Debug --output-on-failure -F
60+
61+
build-macos:
62+
name: macOS
63+
runs-on: macos-13
64+
steps:
65+
- uses: actions/checkout@v4
66+
- name: Configure & build
67+
run: |
68+
mkdir build
69+
cd build
70+
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..
71+
cmake --build .
72+
- name: Run tests
73+
run: |
74+
cd build
75+
ctest -C Debug --output-on-failure -F

.github/workflows/ci_centos.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CentOS Stream 9+
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-centos:
10+
name: CentOS
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
container: quay.io/centos/centos:stream9
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
- name: Prepare
19+
run: |
20+
dnf install git make cmake gcc gcc-c++ binutils glibc-devel valgrind-devel valgrind autoconf libtool bison automake libxml2-devel libatomic sudo which -y
21+
- name: Configure & build
22+
run: |
23+
mkdir build
24+
cd build
25+
cmake .. -DCMAKE_BUILD_TYPE=Debug
26+
cmake --build .
27+
- name: Run tests
28+
run: |
29+
cd build
30+
ctest -C Debug --output-on-failure -F
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: armv7, aarch64, ppc64le
1+
name: ppc64le - ucontext
22

33
on:
44
pull_request:
@@ -13,10 +13,6 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
include:
16-
- target: arm
17-
arch: armv7
18-
- target: aarch64
19-
arch: aarch64
2016
- target: ppc64v2
2117
arch: ppc64le
2218
steps:
@@ -25,6 +21,9 @@ jobs:
2521
with:
2622
arch: ${{ matrix.arch }}
2723
distro: ubuntu_latest
24+
githubToken: ${{ github.token }}
25+
setup: |
26+
mkdir -p "${PWD}/artifacts"
2827
install: |
2928
apt-get update -q -y
3029
apt-get install -q -y --no-install-recommends cmake build-essential
@@ -35,6 +34,9 @@ jobs:
3534
run: |
3635
mkdir build
3736
cd build
38-
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..
37+
cmake -DCMAKE_BUILD_TYPE=Debug ..
3938
cmake --build .
4039
ctest -C Debug --output-on-failure -F
40+
- name: Show the artifact
41+
run: |
42+
ls -al "${PWD}/artifacts"
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: riscv64 & s390x by ucontext .
1+
name: armv7, aarch64, riscv64
22

33
on:
44
pull_request:
@@ -13,16 +13,21 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
include:
16+
- target: arm
17+
arch: armv7
18+
- target: aarch64
19+
arch: aarch64
1620
- target: riscv64
1721
arch: riscv64
18-
- target: s390x
19-
arch: s390x
2022
steps:
2123
- uses: actions/checkout@v4
2224
- uses: uraimo/run-on-arch-action@v3
2325
with:
2426
arch: ${{ matrix.arch }}
2527
distro: ubuntu_latest
28+
githubToken: ${{ github.token }}
29+
setup: |
30+
mkdir -p "${PWD}/artifacts"
2631
install: |
2732
apt-get update -q -y
2833
apt-get install -q -y --no-install-recommends cmake build-essential
@@ -33,6 +38,9 @@ jobs:
3338
run: |
3439
mkdir build
3540
cd build
36-
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..
41+
cmake -DCMAKE_BUILD_TYPE=Debug ..
3742
cmake --build .
3843
ctest -C Debug --output-on-failure -F
44+
- name: Show the artifact
45+
run: |
46+
ls -al "${PWD}/artifacts"

.github/workflows/ci_macos.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ C_API rid_t go(callable_t, u64, ...);
323323
/* Returns results of an completed coroutine, by `result id`, will panic,
324324
if called before `waitfor` returns, `coroutine` still running, or no result
325325
possible function. */
326-
C_API value_t result_for(rid_t);
326+
C_API template result_for(rid_t);
327327

328328
/* Check status of an `result id` */
329329
C_API bool result_is_ready(rid_t);
@@ -349,7 +349,7 @@ MUST use `yielding` to pass data, and `yield_for` to get data. */
349349
C_API generator_t generator(callable_t, u64, ...);
350350

351351
/* Resume specified ~coroutine/generator~, returning data from `yielding`. */
352-
C_API value_t yield_for(generator_t);
352+
C_API template yield_for(generator_t);
353353

354354
/* Return `generator id` in scope for last `yield_for` execution. */
355355
C_API rid_t yield_id(void);
@@ -387,7 +387,7 @@ Returns `vector/array` of `results id`, accessible using `result_for` function.
387387
C_API waitresult_t waitfor(waitgroup_t);
388388

389389
C_API awaitable_t async(callable_t, u64, ...);
390-
C_API value_t await(awaitable_t);
390+
C_API template await(awaitable_t);
391391

392392
/* Calls ~fn~ (with ~number of args~ then ~actaul arguments~) in separate thread,
393393
returning without waiting for the execution of ~fn~ to complete.
@@ -402,7 +402,7 @@ C_API future thrd_launch(thrd_func_t fn, void_t args);
402402

403403
/* Returns the value of `future` ~promise~, a thread's shared object, If not ready, this
404404
function blocks the calling thread and waits until it is ready. */
405-
C_API values_type thrd_get(future);
405+
C_API template_t thrd_get(future);
406406

407407
/* This function blocks the calling thread and waits until `future` is ready,
408408
will execute provided `yield` callback function continuously. */

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ C_API rid_t go(callable_t, u64, ...);
323323
/* Returns results of an completed coroutine, by `result id`, will panic,
324324
if called before `waitfor` returns, `coroutine` still running, or no result
325325
possible function. */
326-
C_API value_t result_for(rid_t);
326+
C_API template result_for(rid_t);
327327

328328
/* Check status of an `result id` */
329329
C_API bool result_is_ready(rid_t);
@@ -349,7 +349,7 @@ MUST use `yielding` to pass data, and `yield_for` to get data. */
349349
C_API generator_t generator(callable_t, u64, ...);
350350

351351
/* Resume specified ~coroutine/generator~, returning data from `yielding`. */
352-
C_API value_t yield_for(generator_t);
352+
C_API template yield_for(generator_t);
353353

354354
/* Return `generator id` in scope for last `yield_for` execution. */
355355
C_API rid_t yield_id(void);
@@ -387,7 +387,7 @@ Returns `vector/array` of `results id`, accessible using `result_for` function.
387387
C_API waitresult_t waitfor(waitgroup_t);
388388

389389
C_API awaitable_t async(callable_t, u64, ...);
390-
C_API value_t await(awaitable_t);
390+
C_API template await(awaitable_t);
391391

392392
/* Calls ~fn~ (with ~number of args~ then ~actaul arguments~) in separate thread,
393393
returning without waiting for the execution of ~fn~ to complete.
@@ -402,7 +402,7 @@ C_API future thrd_launch(thrd_func_t fn, void_t args);
402402

403403
/* Returns the value of `future` ~promise~, a thread's shared object, If not ready, this
404404
function blocks the calling thread and waits until it is ready. */
405-
C_API values_type thrd_get(future);
405+
C_API template_t thrd_get(future);
406406

407407
/* This function blocks the calling thread and waits until `future` is ready,
408408
will execute provided `yield` callback function continuously. */

src/uv_coro.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static uv_fs_event_t *fs_event_create(void);
6363
static uv_tcp_t *tls_tcp_create(void_t extra);
6464
static void_t fs_init(params_t);
6565
static void_t uv_init(params_t);
66-
static value_t uv_start(uv_args_t *uv_args, int type, size_t n_args, bool is_request);
66+
static template uv_start(uv_args_t *uv_args, int type, size_t n_args, bool is_request);
6767
static string stream_get(uv_stream_t *handle);
6868
static udp_packet_t *udp_get(uv_udp_t *handle);
6969
static void udp_packet_free(udp_packet_t *handle);
@@ -315,15 +315,15 @@ static RAII_INLINE void_t coro_fs_poll(params_t args) {
315315
return uv_start((uv_args_t *)args->object, UV_FS_POLL, 4, false).object;
316316
}
317317

318-
static value_t fs_start(uv_args_t *uv_args, uv_fs_type fs_type, size_t n_args, bool is_path) {
318+
static template fs_start(uv_args_t *uv_args, uv_fs_type fs_type, size_t n_args, bool is_path) {
319319
uv_args->fs_type = fs_type;
320320
uv_args->n_args = n_args;
321321
uv_args->is_path = is_path;
322322

323323
return coro_await(fs_init, 1, uv_args);
324324
}
325325

326-
static value_t uv_start(uv_args_t *uv_args, int type, size_t n_args, bool is_request) {
326+
static template uv_start(uv_args_t *uv_args, int type, size_t n_args, bool is_request) {
327327
if (uv_args->is_request = is_request)
328328
uv_args->req_type = type;
329329
else

0 commit comments

Comments
 (0)