Skip to content

Commit 3ca80cf

Browse files
committed
feat: CI
1 parent 522daf4 commit 3ca80cf

File tree

10 files changed

+468
-9
lines changed

10 files changed

+468
-9
lines changed

.config/nextest.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[profile.ci]
2+
# grafbase extension build test compile tons of stuff and thus a super slow.
3+
slow-timeout = { period = "3m", terminate-after = 6 }
4+
retries = 2
5+
failure-output = "immediate-final"
6+
fail-fast = false
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Install Rust
2+
description: Install Rust toolchain
3+
4+
inputs:
5+
components:
6+
description: "Rust components to install"
7+
required: false
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Install Rust
16+
uses: dtolnay/rust-toolchain@master
17+
with:
18+
components: ${{ inputs.components }}
19+
20+
- name: Install toolchain
21+
shell: bash
22+
run: rustup show active-toolchain || rustup toolchain install

.github/workflows/pull-request.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: pull-request
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}-pull-request
11+
cancel-in-progress: true
12+
13+
jobs:
14+
check-format:
15+
runs-on: ubicloud-standard-2
16+
env:
17+
RUSTFLAGS: -D warnings
18+
steps:
19+
- name: Get Sources
20+
uses: actions/checkout@v4
21+
22+
- name: Install Rust
23+
uses: ./.github/actions/install-rust
24+
with:
25+
components: clippy, rustfmt
26+
27+
- name: cargo fmt
28+
shell: bash
29+
run: |
30+
cargo fmt --check
31+
32+
- name: cargo clippy
33+
shell: bash
34+
run: |
35+
cargo clippy --locked
36+
37+
run-tests:
38+
runs-on: ubicloud-standard-8
39+
strategy:
40+
matrix:
41+
version:
42+
- gateway: "0.29.0"
43+
sdk: "0.8.0"
44+
cli: "0.86.1"
45+
env:
46+
RUSTFLAGS: -D warnings
47+
steps:
48+
- name: Get Sources
49+
uses: actions/checkout@v4
50+
51+
- name: Install Rust
52+
uses: ./.github/actions/install-rust
53+
54+
- name: Install cargo-nextest
55+
uses: taiki-e/install-action@v2
56+
with:
57+
tool: nextest
58+
59+
- name: Install CLI
60+
shell: bash
61+
run: |
62+
curl -fsSL https://grafbase.com/downloads/cli | bash -s ${{ matrix.version.cli }}
63+
64+
- name: Install Gateway
65+
shell: bash
66+
run: |
67+
curl -fsSL https://grafbase.com/downloads/gateway | bash -s ${{ matrix.version.gateway }}
68+
69+
- name: cargo test
70+
shell: bash
71+
run: |
72+
cargo run -p test-matrix -- --sdk-version ${{ matrix.version.gateway }}

Cargo.lock

Lines changed: 190 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
resolver = "2"
3-
members = ["extensions/*"]
3+
members = ["extensions/*", "test-matrix"]
44

55
[workspace.package]
66
edition = "2024"

rust-toolchain.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
[toolchain]
22
profile = "default"
33
channel = "1.85.0"
4-
targets = [
5-
"aarch64-apple-darwin",
6-
"x86_64-apple-darwin",
7-
"x86_64-pc-windows-msvc",
8-
"x86_64-unknown-linux-musl",
9-
"aarch64-unknown-linux-musl",
10-
"wasm32-wasip2",
11-
]
4+
targets = ["wasm32-wasip2", "x86_64-unknown-linux-gnu"]

0 commit comments

Comments
 (0)