-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (42 loc) · 1.29 KB
/
cargo-build.yaml
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
name: Postgres NDC build
on:
push:
jobs:
build:
name: Build Postgres NDC
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4
- name: install protoc
uses: arduino/setup-protoc@v3
with:
version: "25.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: install tools
run: |
rustup show
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build" # share the cache across jobs
- name: build crates
run: |
cargo build --release --all-targets --all-features
# Sadly, `cargo build --locked` isn't enough to check that the lockfile
# is up to date, as it will happily run even if there are extra entries in
# there.
#
# It does, however, make sure that the file is not updated, which is quite
# unhelpful.
- name: ensure lockfile hasn't changed
run: |
if [[ -n "$(git status --porcelain Cargo.lock)" ]]; then
echo 'The Cargo.lock file was changed!'
git diff Cargo.lock
exit 1
fi
- name: lint
run: |
cargo clippy --release --all-targets --all-features