Skip to content

Commit

Permalink
refactor ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Aug 8, 2024
1 parent c18d706 commit 7fc8136
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
8 changes: 8 additions & 0 deletions .github/server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -Eeuo pipefail

SERVER=/tmp/echo-server
go build -o ${SERVER} server/main.go
${SERVER} &
sleep 10
10 changes: 2 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ jobs:
make test
- name: Run examples
run: |
SERVER=/tmp/echo-server
go build -o ${SERVER} server/main.go
${SERVER} &
sleep 10
./.github/server.sh
make run
- name: Install deps
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -83,10 +80,7 @@ jobs:
make test
- name: Run examples
run: |
SERVER=/tmp/echo-server
go build -o ${SERVER} server/main.go
${SERVER} &
sleep 10
./.github/server.sh
make run
- name: Install deps
if: matrix.os == 'ubuntu-latest'
Expand Down
16 changes: 9 additions & 7 deletions .woodpecker/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
steps:
- name: zig
image: ziglings/ziglang:latest
pull: true
image: ghcr.io/jiacai2050/playground:zig-20240808-b5c8f704
# https://woodpecker-ci.org/docs/usage/workflow-syntax#entrypoint
# Change entrypoint to `bash -lc`
entrypoint: ["/bin/bash", "-lc", "echo $CI_SCRIPT | base64 -d | /bin/bash -e"]
commands:
- zig version
- zig fmt --check .
- zig build run-basic -freference-trace
- zig build run-advanced -freference-trace
- zig build run-multi -freference-trace
- asdf plugin add golang https://github.com/asdf-community/asdf-golang.git
- asdf install golang latest && asdf global golang latest
- ./.github/server.sh
- make test
- make run

when:
- event: [push, cron]
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

ARGS = ${ZIG_ARGS}

prepare:
./libs/update.sh

clean:
rm -rf zig-cache zig-out

Expand All @@ -16,7 +13,10 @@ run:
zig build run-multi -freference-trace $(ARGS)
zig build run-header -freference-trace $(ARGS)

test:
lint:
zig fmt --check .

test: lint
zig build test $(ARGS)

docs:
Expand Down
8 changes: 2 additions & 6 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#+TITLE: zig-curl
#+DATE: 2023-09-16T23:16:15+0800
#+LASTMOD: 2024-05-12T13:20:36+0800
#+LASTMOD: 2024-08-08T19:49:59+0800
#+OPTIONS: toc:nil num:nil
#+STARTUP: content

[[https://img.shields.io/badge/zig%20version-0.12.0-blue.svg]]
[[https://img.shields.io/badge/zig%20version-0.13.0-blue.svg]]
[[https://img.shields.io/badge/zig%20version-master-blue.svg]]
[[https://github.com/jiacai2050/zig-curl/actions/workflows/CI.yml][https://github.com/jiacai2050/zig-curl/actions/workflows/CI.yml/badge.svg]]
[[https://ci.codeberg.org/repos/13257][https://ci.codeberg.org/api/badges/13257/status.svg]]
Expand Down Expand Up @@ -64,9 +64,5 @@ exe.linkSystemLibrary("curl");
exe.linkLibC();
#+end_src

* Roadmap

- [x] Currently only easy API is supported, support [[https://curl.se/libcurl/c/libcurl-multi.html][multi API]].

* License
[[file:LICENSE][MIT]]

0 comments on commit 7fc8136

Please sign in to comment.