Skip to content

Commit b2a3d5a

Browse files
jyn514Joshua Nelson
authored and
Joshua Nelson
committed
Use variables from .env.sample instead of rewriting them
This will also make it easier to make changes in the future, since only one place has to be updated with the new default variables.
1 parent f4ef5c5 commit b2a3d5a

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,16 @@ jobs:
4949
restore-key: |
5050
${{ runner.os }}-cargo-build-target-${{ env.CURRENT_RUSTC_VERSION }}-
5151
52-
- name: Prepare the test environment
53-
run: |
54-
prefix=$(pwd)/ignored/prefix
55-
mkdir -p ${prefix}/public-html
56-
echo "::set-env name=CRATESFYI_PREFIX::${prefix}"
57-
5852
- name: Launch the postgres image
5953
run: |
60-
touch .env
54+
cp .env.sample .env
55+
. .env
56+
mkdir -p ${CRATESFYI_PREFIX}/public-html
6157
docker-compose up -d db
62-
# TODO: try to avoid hard-coding this username/password
63-
export CRATESFYI_DATABASE_URL="postgresql://cratesfyi:password@localhost:5432/"
64-
# Make sure the database is actually working
6558
# Give the database enough time to start up
6659
sleep 5
67-
psql "$CRATESFYI_DATABASE_URL"
68-
echo "::set-env name=CRATESFYI_DATABASE_URL::${CRATESFYI_DATABASE_URL}"
60+
# Make sure the database is actually working
61+
psql "${CRATESFYI_DATABASE_URL}"
6962
7063
- name: Run rustfmt
7164
run: cargo fmt -- --check

0 commit comments

Comments
 (0)