From 8d85e0190c2cf77677671bc42540b943c61d65a8 Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Wed, 7 Aug 2024 23:14:41 +0800 Subject: [PATCH] refactor ci --- .github/server.sh | 8 ++++++++ .github/workflows/CI.yml | 10 ++-------- .woodpecker/ci.yml | 12 ++++++------ Makefile | 8 ++++---- README.org | 8 ++------ 5 files changed, 22 insertions(+), 24 deletions(-) create mode 100755 .github/server.sh diff --git a/.github/server.sh b/.github/server.sh new file mode 100755 index 0000000..bfa2a24 --- /dev/null +++ b/.github/server.sh @@ -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 diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8c43377..e14f5a5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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' @@ -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' diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml index 2b56964..504732b 100644 --- a/.woodpecker/ci.yml +++ b/.woodpecker/ci.yml @@ -1,13 +1,13 @@ steps: - name: zig - image: ziglings/ziglang:latest - pull: true + image: ghcr.io/jiacai2050/playground:zig-20240807-bd9e04ba 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] diff --git a/Makefile b/Makefile index c854027..d399326 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,6 @@ ARGS = ${ZIG_ARGS} -prepare: - ./libs/update.sh - clean: rm -rf zig-cache zig-out @@ -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: diff --git a/README.org b/README.org index 0fa4076..08a4297 100644 --- a/README.org +++ b/README.org @@ -1,10 +1,10 @@ #+TITLE: zig-curl #+DATE: 2023-09-16T23:16:15+0800 -#+LASTMOD: 2024-05-12T13:20:36+0800 +#+LASTMOD: 2024-08-07T23:14:03+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]] @@ -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]]