Skip to content

Commit 5f5153d

Browse files
committed
#1: update env loading in ci
1 parent 561eaed commit 5f5153d

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

.github/workflows/build-and-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,16 @@ jobs:
153153
ls -l; \
154154
chmod +x ./build.sh; \
155155
\
156-
export $(cat .env | egrep -v "(^#.*|^$)" | xargs) && export FOO_COVERAGE_ENABLED=${{ env.COVERAGE_ENABLED }} ./build.sh'
156+
export FOO_COVERAGE_ENABLED=${{ env.COVERAGE_ENABLED }} && ./build.sh'
157157
158158
echo "Running ${CMD}"
159159
160160
if [[ "${{ matrix.runner.image }}" == "" ]]; then
161-
bash -c "$CMD";
161+
source .env && bash -c "$CMD";
162162
else
163163
docker run \
164164
--name test-container \
165+
--env-file ./.env \
165166
-w $WORKSPACE \
166167
-v ${{ github.workspace }}:/workspace \
167168
-v ${{ env.BUILD_DIR }}:/opt/foo/build \

build-in-docker.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,16 @@ IMAGE=lifflander1/vt:wf-amd64-ubuntu-20.04-clang-9-cpp
2727

2828
CMD='
2929
cd '$WORKSPACE'; \
30-
nvcc --version; \
3130
ls -l;
3231
chmod +x ./build.sh; \
3332
\
34-
export $(cat .env | egrep -v "(^#.*|^$)" | xargs) && ./build.sh'
33+
./build.sh'
3534

3635
# in host: volume for build dir should be /tmp/cache/amd64-ubuntu-22.04-gcc-12-gcc-12-cache/ubuntu-cpp (example from VT)
3736

38-
# docker run \
39-
# --name test-container \
40-
# -w $WORKSPACE \
41-
# -v .:/workspace \
42-
# -v /opt/foo/build:/opt/foo/build \
43-
# -v /opt/foo/output:/opt/foo/output \
44-
# -e CI="1" \
45-
# -e https_proxy="" \
46-
# -e http_proxy="" \
47-
# $IMAGE \
48-
# bash -c "$CMD"
49-
5037
docker run \
51-
-it \
5238
--name test-container \
39+
--env-file ./.env \
5340
-w $WORKSPACE \
5441
-v .:/workspace \
5542
-v /opt/foo/build:/opt/foo/build \
@@ -58,3 +45,17 @@ docker run \
5845
-e https_proxy="" \
5946
-e http_proxy="" \
6047
$IMAGE \
48+
bash -c "$CMD"
49+
50+
# To test interactively run the following
51+
# docker run \
52+
# -it \
53+
# --name test-container \
54+
# -w $WORKSPACE \
55+
# -v .:/workspace \
56+
# -v /opt/foo/build:/opt/foo/build \
57+
# -v /opt/foo/output:/opt/foo/output \
58+
# -e CI="1" \
59+
# -e https_proxy="" \
60+
# -e http_proxy="" \
61+
# $IMAGE \

0 commit comments

Comments
 (0)