Repository navigation
118 lines (98 loc) · 2.95 KB
/
Copy pathci.yml
File metadata and controls
118 lines (98 loc) · 2.95 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
msrv:
name: Rust 1.94.0
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust 1.94.0
uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: "1.94.0"
- name: Check MSRV
run: rustup run 1.94.0 cargo check --locked --workspace --all-features --all-targets
- name: Test MSRV
run: rustup run 1.94.0 cargo test --locked -p sqlc-gen-sqlx --all-features --lib --test codegen
test:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
services:
postgres:
image: postgres:18.6-alpine
env:
POSTGRES_USER: sqlc
POSTGRES_PASSWORD: sqlc
POSTGRES_DB: sqlc_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install sqlc
uses: sqlc-dev/setup-sqlc@bac53b7fb28c039a6c7f5736fd1e89744021bdd6 # v5.0.0
with:
sqlc-version: "1.31.1"
- name: Install Rust stable
uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
targets: wasm32-wasip1
- name: Snapshot tests
run: cargo test --workspace
env:
INSTA_UPDATE: unseen
- name: Build WASM plugin
run: cargo build --target wasm32-wasip1
- name: Integration tests
run: cargo test -p basic
env:
DATABASE_URL: postgres://sqlc:sqlc@localhost:5432/sqlc_test
- name: Verify package
run: cargo package --locked
proto-check:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install buf
uses: bufbuild/buf-action@37ac33d8960807670a6e9719080e885197b09cc6 # v1.7.0
with:
setup_only: true
- name: Install protoc-gen-buffa
run: cargo install --locked protoc-gen-buffa@0.9.2 protoc-gen-buffa-packaging@0.9.2
- name: Verify proto bindings are up to date
run: |
buf generate
cargo fmt --all
git diff --exit-code -- src
prebuilt:
permissions:
contents: read
name: Verify prebuilt distribution
uses: $/.github/workflows/prebuilt.yml