forked from agentgateway/agentgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (122 loc) · 4.22 KB
/
pull_request.yml
File metadata and controls
131 lines (122 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Branch
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
CI: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
# Performance is horrendous on musl without jemalloc
features: jemalloc
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-musl
# Performance is horrendous on musl without jemalloc
# TODO: arm64 build fails with jemalloc for some reason?
features: default
- os: macos-latest
target: aarch64-apple-darwin
features: default
- os: windows-latest
target: x86_64-pc-windows-msvc
features: default
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 23
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
# Github cache is too tiny to handle the full matrix :-(
if: ${{ matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-latest' }}
with:
# Github cache will restore from 'main' OR the current branch.
# If we cache PR branches, we may evict the 'main' cache and end up with no cache hits at all.
# Ideally, we would have main be 'high priority' and not be evicted but I don't think thats possible.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build UI
run: |
cd ui
npm ci
npm run build
- name: Install musl-tools
if: ${{ matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
rustup target add ${{ matrix.target }}
- name: Build
run: "cargo build --features ui --target ${{ matrix.target }} -F ${{ matrix.features }} --profile quick-release"
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v6
with:
go-version: '1.25'
- name: Install jq on Windows
if: runner.os == 'Windows'
run: choco install jq -y
- name: Install protoc-gen-go on Windows
if: runner.os == 'Windows'
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# Github cache is too tiny to handle the full matrix :-(
if: ${{ matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-latest' }}
with:
# Github cache will restore from 'main' OR the current branch.
# If we cache PR branches, we may evict the 'main' cache and end up with no cache hits at all.
# Ideally, we would have main be 'high priority' and not be evicted but I don't think thats possible.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Add Go bin to PATH
shell: bash
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Test
run: make test
- name: Validate
run: make validate
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v6
with:
go-version: '1.25'
- uses: actions/setup-node@v4
with:
node-version: 23
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Github cache will restore from 'main' OR the current branch.
# If we cache PR branches, we may evict the 'main' cache and end up with no cache hits at all.
# Ideally, we would have main be 'high priority' and not be evicted but I don't think thats possible.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Add Go bin to PATH
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Generation
run: git config --global core.autocrlf true; make gen check-clean-repo
- name: Lint
run: make lint
- name: Lint UI
run: |
cd ui
npm ci
npm run lint