Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up + add support for rustls builds #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
version: 2.1
_locals:
defaults: &defaults
resource_class: xlarge
machine:
image: ubuntu-2204:2023.02.1
docker_layer_caching: true
environment: &environment
# The cache is only keyed on Cargo.lock, so we can't really do
# incremental builds; disabling it avoids the overhead.
CARGO_INCREMENTAL: "false"
cache_paths: &cache_paths
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
- /home/circleci/.cargo/bin/
- /home/circleci/.cargo/registry/index/
- /home/circleci/.cargo/registry/cache/
- /home/circleci/.cargo/git/db/
workflows:
build-and-test:
jobs:
- test-dynamic
- test-static
commands:
install_rust:
steps:
- run:
name: Install rust
command: |
sudo wget -O /usr/local/bin/rustup-init \
https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
sudo chmod +x /usr/local/bin/rustup-init
rustup-init -y
source "$HOME/.cargo/env"
rustup install nightly
jobs:
test-dynamic:
<<: *defaults
steps:
- checkout
- install_rust
- restore_cache:
keys:
- v1-debug-dynamic-{{ arch }}-{{ checksum "Cargo.lock" }}
- run: make build
- run: make release
- run: make lint
# Build test bins so we can cache it.
- run: make build-test
- save_cache:
key: v1-debug-dynamic-{{ arch }}-{{ checksum "Cargo.lock" }}
paths: *cache_paths
- run: make test
test-static:
<<: *defaults
environment:
<<: *environment
# These instruct the cargo to perform static builds.
RUSTFLAGS: "-C target-feature=+crt-static"
CARGO_BUILD_TARGET: "x86_64-unknown-linux-gnu"
steps:
- checkout
- install_rust
- restore_cache:
keys:
- v1-debug-static-{{ arch }}-{{ checksum "Cargo.lock" }}
- run: make build
- run: make release
- run: make lint
# Build test bins so we can cache it.
- run: make build-test
- save_cache:
key: v1-debug-static-{{ arch }}-{{ checksum "Cargo.lock" }}
paths: *cache_paths
- run: make test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
target
Cargo.lock
.idea/
2 changes: 2 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
edition = "2021"
max_width = 120
Loading