-
Notifications
You must be signed in to change notification settings - Fork 18
55 lines (51 loc) · 2.08 KB
/
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
51
52
53
54
55
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Cancel already running jobs
concurrency:
group: build_${{ github.head_ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
strategy:
matrix:
include:
- name: Ubuntu 22.04 - Release - x86_64
runner: ubuntu-22.04
cargo_flags: --release
- name: Ubuntu 22.04 - Release - aarch64
runner: ubuntu-22.04
cargo_flags: --target aarch64-unknown-linux-gnu --release
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
steps:
- name: cache custom ubuntu packages
uses: actions/cache@v4
with:
path: shotover-proxy/build/packages
key: ubuntu-22.04-packages
- uses: actions/checkout@v4
# We purposefully dont cache here as build_and_test will always be the bottleneck
# so we should leave the cache alone so build_and_test can make more use of it.
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
# This can be removed when we swap to aarch64 runners instead of cross compiling
- name: Install aarch64 gcc
run: sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: cargo-hack@0.6.16
- name: Ensure that dev tools compiles and has no warnings with no features enabled
run: cargo clippy --locked ${{ matrix.cargo_flags }} --all-targets -- -D warnings
- name: Ensure that shotover-proxy compiles and has no warnings under every possible combination of features
# some things to explicitly point out:
# * clippy also reports rustc warnings and errors
# * clippy --all-targets is not run so we only build the shotover_proxy executable without the tests/benches
run: cargo hack --feature-powerset --at-least-one-of valkey,cassandra,kafka,opensearch clippy --locked ${{ matrix.cargo_flags }} --package shotover-proxy -- -D warnings