Skip to content

Commit 4d1a120

Browse files
Add CI workflows
1 parent ae613be commit 4d1a120

5 files changed

Lines changed: 1517 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
examples:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up Go
14+
uses: actions/setup-go@v5
15+
with:
16+
go-version: "1.23"
17+
18+
- name: Regenerate examples
19+
run: make -C _examples generate
20+
21+
- name: Git diff of regenerated files
22+
run: make -C _examples diff
23+
24+
tests:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v5
31+
with:
32+
go-version: "1.23"
33+
34+
- name: Install native dependencies
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y build-essential pkg-config libcurl4-openssl-dev libcjson-dev
38+
39+
- name: Run generator tests
40+
run: go test ./...

_examples/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
WEBRPC_GEN_VERSION := v0.37.1
2+
ROOT := ..
3+
GEN := go run -ldflags="-X github.com/webrpc/webrpc.VERSION=$(WEBRPC_GEN_VERSION)" github.com/webrpc/webrpc/cmd/webrpc-gen@$(WEBRPC_GEN_VERSION)
4+
5+
.PHONY: generate diff
6+
7+
generate:
8+
$(GEN) -schema=smoke/example.ridl -target=$(ROOT) -emit=header -out=smoke/example.gen.h
9+
$(GEN) -schema=smoke/example.ridl -target=$(ROOT) -emit=impl -header=example.gen.h -out=smoke/example.gen.c
10+
11+
diff:
12+
git diff --exit-code -- smoke/example.gen.h smoke/example.gen.c

0 commit comments

Comments
 (0)