Skip to content

Commit

Permalink
Merge pull request #279 from sourcefrog/default-features
Browse files Browse the repository at this point in the history
Build s3 & sftp by default
  • Loading branch information
sourcefrog authored Dec 15, 2024
2 parents 00b929a + 2fbd23e commit 74a0473
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
features: ["", "s3"]
version: [stable, nightly, "1.79"]

steps:
Expand All @@ -61,21 +60,17 @@ jobs:
with:
toolchain: ${{ matrix.version }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.features }}
- name: Show version
run: |
rustup show
cargo --version
rustc --version
- name: Build
run: >
cargo build --all-targets --no-default-features --features=${{
matrix.features }} --features fail/failpoints
cargo build --all-targets --features fail/failpoints
- name: Test
run: >
cargo test --no-default-features --features=${{ matrix.features }}
--features fail/failpoints -- --include-ignored
cargo test --features fail/failpoints -- --include-ignored
# Run rustfmt separately so that it does not block test results
rustfmt:
Expand Down Expand Up @@ -136,8 +131,8 @@ jobs:
tool: cargo-mutants
- name: Mutants in diff
run: >
cargo mutants --no-shuffle -vV --in-diff git.diff --in-place -- --features
fail/failpoints
cargo mutants --no-shuffle -vV --in-diff git.diff --in-place --
--features fail/failpoints
- name: Archive mutants.out
uses: actions/upload-artifact@v4
if: always()
Expand Down Expand Up @@ -168,11 +163,10 @@ jobs:
# Don't use the S3 features because they require AWS credentials for realistic
# testing.
run: |
cargo mutants --no-shuffle -vV --cargo-arg=--no-default-features \
--in-place \
--baseline=skip --shard ${{ matrix.shard }}/10 \
-- \
--features fail/failpoints
cargo mutants --no-shuffle -vV --in-place --baseline=skip \
--shard ${{ matrix.shard }}/10 \
-- \
--features fail/failpoints
- name: Archive results
uses: actions/upload-artifact@v4
if: always()
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ version = "24.8.0"
rust-version = "1.79"

[features]
default = ["s3", "sftp"]
s3 = [
"dep:aws-config",
"dep:aws-sdk-s3",
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ automatically excluded from backups.
From 23.9 Conserve supports storing backups in Amazon S3. AWS IAM credentials are
read from the standard sources: the environment, config file, or, on EC2, the instance metadata service.

S3 support is not built by default, but can be turned on by passing `cargo install --features s3`.

To use this, just specify an S3 URL for the archive location. The bucket must already exist.

conserve init s3://my-bucket/
Expand All @@ -142,10 +140,10 @@ To install from a git checkout, run

### Optional features

The following options can be enabled with `--features`:
The following features are enabled by default, but can be turned off with `cargo install --no-default-features` if they are not needed:

* `s3`: support for storing backups in Amazon S3 (or compatible services)
* `sftp`: support for storing backups on SFTP servers, addressed with `sftp://` URLs
- `s3`: support for storing backups in Amazon S3 (or compatible services)
- `sftp`: support for storing backups on SFTP servers, addressed with `sftp://` URLs

### Arch Linux

Expand Down

0 comments on commit 74a0473

Please sign in to comment.