Skip to content

Commit

Permalink
Merge pull request #5 from CosmWasm/min-max-builds
Browse files Browse the repository at this point in the history
Add minimal/maximal versions builds, make minimal pass
  • Loading branch information
uint authored Oct 24, 2022
2 parents 77c6c24 + 1e0a279 commit 03026cc
Show file tree
Hide file tree
Showing 5 changed files with 936 additions and 14 deletions.
77 changes: 73 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,32 @@ workflows:
test:
jobs:
- build_and_test
- build_minimal
- build_maximal
- lint
- coverage
nightly:
triggers:
- schedule:
# Built every weekday night
cron: "0 0 * * 1-5"
filters:
branches:
only:
- main
jobs:
# Build with minimal versions of dependencies
- build_minimal
# Build with maximal versions of dependencies
- build_maximal

jobs:
build_and_test:
docker:
- image: rust:1.64.0
working_directory: ~/project
steps:
- checkout:
path: ~/project
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
Expand All @@ -27,7 +42,7 @@ jobs:
command: cargo update
- restore_cache:
keys:
- cargocache-v2-multi-test:1.64.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-v2-multi-test:1.64.0-{{ checksum "Cargo.lock" }}
- cargocache-v2-multi-test:1.64.0-
- run:
name: Build library for native target
Expand All @@ -42,7 +57,61 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-v2-multi-test:1.64.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-v2-multi-test:1.64.0-{{ checksum "Cargo.lock" }}

build_minimal:
docker:
- image: rustlang/rust:nightly
working_directory: ~/project/
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- run:
name: Remove Cargo.lock
command: rm Cargo.lock
- restore_cache:
keys:
- cargocache-v2-multi-test:1.64.0-minimal-{{ checksum "Cargo.toml" }}
- run:
name: Build library for native target
command: cargo build -Zminimal-versions --all-features
- run:
name: Run unit tests
command: cargo test --workspace -Zminimal-versions --all-features
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-v2-multi-test:1.64.0-minimal-{{ checksum "Cargo.toml" }}

build_maximal:
docker:
- image: rust:1.64.0
working_directory: ~/project/
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- run:
name: Update Cargo.lock
command: cargo update
- restore_cache:
keys:
- cargocache-v2-multi-test:1.64.0-{{ checksum "Cargo.lock" }}
- run:
name: Build library for native target
command: cargo build --locked --all-features
- run:
name: Run unit tests
command: cargo test --workspace --locked --all-features
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-v2-multi-test:1.64.0-{{ checksum "Cargo.lock" }}

lint:
docker:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# macOS
.DS_Store

# dependency resolution lock
/Cargo.lock

# Text file backups
**/*.rs.bk

Expand Down
Loading

0 comments on commit 03026cc

Please sign in to comment.