Skip to content

Commit 916b770

Browse files
authored
Refine v3 core and add modular validation (#12)
refine v3 core and add modular validation
1 parent bc310e5 commit 916b770

53 files changed

Lines changed: 2736 additions & 1004 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ci-${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
root:
23+
name: Root checks
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Go
30+
uses: actions/setup-go@v5
31+
with:
32+
go-version-file: go.mod
33+
cache: true
34+
35+
- name: Verify root tests
36+
run: go test ./...
37+
38+
- name: Verify race detector
39+
run: go test -race ./...
40+
41+
- name: Verify go vet
42+
run: go vet ./...
43+
44+
validation-playground:
45+
name: Validation submodule
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Go
52+
uses: actions/setup-go@v5
53+
with:
54+
go-version-file: validation/playground/go.mod
55+
cache: true
56+
57+
- name: Download validation module dependencies
58+
working-directory: validation/playground
59+
env:
60+
GOWORK: off
61+
run: go mod download
62+
63+
- name: Verify validation/playground
64+
working-directory: validation/playground
65+
env:
66+
GOWORK: off
67+
run: go test ./...
68+
69+
examples:
70+
name: Examples (${{ matrix.example }})
71+
runs-on: ubuntu-latest
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
example:
76+
- examples/stdmux
77+
- examples/gorillamux
78+
- examples/chi
79+
- examples/restapi
80+
steps:
81+
- name: Checkout
82+
uses: actions/checkout@v4
83+
84+
- name: Setup Go
85+
uses: actions/setup-go@v5
86+
with:
87+
go-version-file: ${{ matrix.example }}/go.mod
88+
cache: true
89+
90+
- name: Download example module dependencies
91+
working-directory: ${{ matrix.example }}
92+
env:
93+
GOWORK: off
94+
run: go mod download
95+
96+
- name: Verify example module
97+
working-directory: ${{ matrix.example }}
98+
env:
99+
GOWORK: off
100+
run: go test ./...
101+
102+
workspace:
103+
name: Workspace sync
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: Checkout
107+
uses: actions/checkout@v4
108+
109+
- name: Setup Go
110+
uses: actions/setup-go@v5
111+
with:
112+
go-version-file: go.mod
113+
cache: true
114+
115+
- name: Sync go.work
116+
run: go work sync
117+
118+
- name: Verify workspace is clean
119+
run: git diff --exit-code -- go.work go.work.sum

.github/workflows/go.yml

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

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: release-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
verify:
18+
name: Verify before release
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version-file: go.mod
28+
cache: true
29+
30+
- name: Root tests
31+
run: go test ./...
32+
33+
- name: Root race tests
34+
run: go test -race ./...
35+
36+
- name: Download validation module dependencies
37+
working-directory: validation/playground
38+
env:
39+
GOWORK: off
40+
run: go mod download
41+
42+
- name: Validation submodule tests
43+
working-directory: validation/playground
44+
env:
45+
GOWORK: off
46+
run: go test ./...
47+
48+
- name: Download REST API example dependencies
49+
working-directory: examples/restapi
50+
env:
51+
GOWORK: off
52+
run: go mod download
53+
54+
- name: REST API example tests
55+
working-directory: examples/restapi
56+
env:
57+
GOWORK: off
58+
run: go test ./...
59+
60+
github-release:
61+
name: Publish GitHub release
62+
runs-on: ubuntu-latest
63+
needs: verify
64+
steps:
65+
- name: Create GitHub release
66+
uses: softprops/action-gh-release@v2
67+
with:
68+
generate_release_notes: true

0 commit comments

Comments
 (0)