Skip to content

Commit 6703c1b

Browse files
committed
remove dotenv dependency
1 parent 69070c1 commit 6703c1b

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ on:
88

99
env:
1010
RUST_BACKTRACE: 1
11+
DOCSRS_PREFIX: ignored/cratesfyi-prefix
12+
DOCSRS_DATABASE_URL: postgresql://cratesfyi:password@localhost:15432
13+
DOCSRS_LOG: docs_rs=debug,rustwide=info
14+
AWS_ACCESS_KEY_ID: cratesfyi
15+
AWS_SECRET_ACCESS_KEY: secret_key
16+
S3_ENDPOINT: http://localhost:9000
17+
DOCSRS_INCLUDE_DEFAULT_TARGETS: false
18+
DOCSRS_DOCKER_IMAGE: ghcr.io/rust-lang/crates-build-env/linux-micro
19+
SENTRY_ENVIRONMENT: dev
20+
DOCSRS_METADATA_HOST_TARGET: aarch64-unknown-linux-gnu
1121

1222
jobs:
1323
build:
@@ -57,7 +67,6 @@ jobs:
5767
- name: Launch postgres and min.io
5868
run: |
5969
cp .env.sample .env
60-
. .env
6170
mkdir -p ${DOCSRS_PREFIX}/public-html
6271
docker-compose up -d db s3
6372
# Give the database enough time to start up
@@ -93,7 +102,6 @@ jobs:
93102
- name: Launch postgres and min.io
94103
run: |
95104
cp .env.sample .env
96-
. .env
97105
mkdir -p ${DOCSRS_PREFIX}/public-html
98106
docker-compose up -d db s3
99107
# Give the database enough time to start up
@@ -104,13 +112,12 @@ jobs:
104112
- name: slow tests
105113
env:
106114
DOCSRS_INCLUDE_DEFAULT_TARGETS: true
107-
DOCSRS_DOCKER_IMAGE: ghcr.io/rust-lang/crates-build-env/linux-micro
108115
run: |
109116
for f in ./test-binaries/*; do
110117
echo "running $f"
111118
chmod +x $f # GH action artifacts don't handle permissions
112119
# run build-tests. Limited to one thread since we don't support parallel builds.
113-
$f --ignored --test-threads=1 || exit 1
120+
$f --ignored --test-threads=1 || exit 1
114121
done
115122
116123
- name: Clean up the database

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ systemstat = "0.2.0"
5151
prometheus = { version = "0.13.0", default-features = false }
5252
rustwide = "0.15.0"
5353
mime_guess = "2"
54-
dotenv = "0.15"
5554
zstd = "0.11.0"
5655
git2 = { version = "0.14.0", default-features = false }
5756
path-slash = "0.2.0"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ mkdir -p ignored/cratesfyi-prefix/crates.io-index
6464
cargo build
6565
# Start the external services
6666
docker-compose up -d db s3
67+
# anything that doesn't run via docker-compose needs the settings defined in
68+
# .env. Either via `. .env` as below, or via any dotenv shell integration
69+
(dotenv, direnv, ...).
70+
. .env
6771
# Setup the database you just created
6872
cargo run -- database migrate
6973
# Build a sample crate to make sure it works

src/bin/cratesfyi.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ use structopt::StructOpt;
1616
use strum::VariantNames;
1717

1818
fn main() {
19-
let _ = dotenv::dotenv();
20-
2119
let _sentry_guard = if let Ok(sentry_dsn) = env::var("SENTRY_DSN") {
2220
rustwide::logging::init_with(SentryLogger::with_dest(logger_init()));
2321
Some(sentry::init((

src/test/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ use reqwest::{
1919
use std::{fs, net::SocketAddr, panic, sync::Arc, time::Duration};
2020

2121
pub(crate) fn wrapper(f: impl FnOnce(&TestEnvironment) -> Result<()>) {
22-
let _ = dotenv::dotenv();
23-
2422
let env = TestEnvironment::new();
2523
// if we didn't catch the panic, the server would hang forever
2624
let maybe_panic = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&env)));

0 commit comments

Comments
 (0)