Skip to content

Commit

Permalink
combine whole step into one RUN
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibbelink committed Feb 7, 2024
1 parent 5cf0200 commit d97e7ca
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,19 @@ ARG make_cores=2

COPY . /cyclus
WORKDIR /cyclus
RUN python install.py -j 2 --build-type=Release --core-version 999999.999999 --allow-milps --code_coverage
ENV PATH /root/.local/bin:$PATH
ENV LD_LIBRARY_PATH /root/.local/lib:/root/.local/lib/cyclus
RUN lcov -c --rc lcov_branch_coverage=1 -d build/src -o initial_coverage.info --gcov-tool ${GCOV} --initial && \
RUN --mount=type=bind,target=. \
--mount=type=secret,id=GITHUB_TOKEN \
python install.py -j 2 --build-type=Release --core-version 999999.999999 --allow-milps --code_coverage && \
lcov -c --rc lcov_branch_coverage=1 -d build/src -o initial_coverage.info --gcov-tool ${GCOV} --initial && \
cyclus_unit_tests && \
cd tests && python -m pytest --ignore test_main.py && cd .. && \
lcov -c --rc lcov_branch_coverage=1 -d build/src -o test_coverage.info --gcov-tool ${GCOV} && \
lcov --add-tracefile initial_coverage.info --add-tracefile test_coverage.info --rc lcov_branch_coverage=1 -o total_coverage.info && \
lcov --remove total_coverage.info -o src_coverage.info --rc lcov_branch_coverage=1 "/usr/**" "/opt/**"
RUN --mount=type=secret,id=GITHUB_TOKEN \
lcov --remove total_coverage.info -o /cyclus/src_coverage.info --rc lcov_branch_coverage=1 "/usr/**" "/opt/**" && \
curl -L https://coveralls.io/coveralls-linux.tar.gz | tar -xz -C /usr/local/bin && \
COVERALLS_REPO_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) coveralls report src_coverage.info --format=lcov --compare-ref=main -p --job-flag ${ubuntu-version}-${pkg_mgr}
COVERALLS_REPO_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) coveralls report /cyclus/src_coverage.info --format=lcov --compare-ref=main -p --job-flag ${ubuntu-version}-${pkg_mgr}

FROM ${pkg_mgr}-deps as cyclus
ARG make_cores=2
Expand Down

0 comments on commit d97e7ca

Please sign in to comment.