Skip to content

Commit

Permalink
avoid doubled checkout
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik <[email protected]>
  • Loading branch information
Dominik-K committed Dec 23, 2023
1 parent 90f4781 commit 6d4a2e1
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }}
env:
CACHE_PATH: /tmp/cache
CI_REPO: EVerest/everest-core
steps:
- name: Format branch name for cache key
run: |
Expand All @@ -55,24 +56,17 @@ jobs:
restore-keys: |
compile-${{ env.branch_name_for_cache }}-
compile-
- name: Checkout from `everest-core` the `.ci/` directory (reusable workflow mode, see https://stackoverflow.com/a/74123003/1168315)
- name: Checkout `${{ env.CI_REPO }}` (to only get the `.ci/` directory if reusable workflow mode, see https://stackoverflow.com/a/74123003/1168315)
uses: actions/checkout@v4
with:
sparse-checkout: |
.ci
repository: EVerest/everest-core
path: ci-repo
repository: ${{ env.CI_REPO }}
ref: CI/reusable-workflow # TODO get reference in general, see https://stackoverflow.com/questions/74784735 resp. https://github.com/actions/toolkit/issues/1264
- name: Move `.ci/` to `/tmp` and remove `everest-core`
run: |
mv .ci /tmp
pwd && ls -hal .
cd ..
pwd && ls -hal .
rm -rf everest-core
pwd && ls -hal .
- name: Checkout repo ${{ inputs.repository || 'EVerest/everest-core' }}
- name: Checkout repo ${{ inputs.repository }}
if: ${{ github.repository != env.CI_REPO }}
uses: actions/checkout@v4
with:
path: source
repository: ${{ inputs.repository }}
ref: ${{ inputs.repository_ref }}
- name: Pull build-kit image
Expand All @@ -82,11 +76,12 @@ jobs:
- name: Build and install
env:
CMAKE_FLAGS_EXTRA: ${{ inputs.cmake_flags_extra || '-DEVC_ENABLE_CCACHE=1 -DISO15118_2_GENERATE_AND_INSTALL_CERTIFICATES=OFF' }}
working-directory: source
run: |
ls -hal .
docker run \
--volume "${CACHE_PATH:?}:/ext/cache" \
--volume "/tmp/.ci:/.ci" \
--volume "ci-repo/.ci:/.ci" \
--volume "$(pwd):$(pwd)" \
--workdir "$(pwd)" \
--env CMAKE_FLAGS_EXTRA="${CMAKE_FLAGS_EXTRA:?}" \
Expand All @@ -100,20 +95,22 @@ jobs:
path: build/CMakeFiles/
- name: Unit tests
if: ${{ inputs.unit_tests || false }}
working-directory: source
run: |
docker commit build-container unit-tests-image
trap "cp build/Testing/Temporary/LastTest.log /tmp/ctest-report" EXIT
docker run \
--volume "ci-repo/.ci:/.ci" \
--volume "$(pwd):$(pwd)" \
--volume "/tmp/.ci:/.ci" \
--workdir "$(pwd)" \
--name test-container \
unit-tests-image /.ci/build-kit/unit_tests.sh
- name: Integration tests
if: ${{ inputs.integration_tests || true }}
working-directory: /tmp/.ci/e2e/
working-directory: source
run: |
docker commit build-container integration-tests-image
pushd ci-repo/.ci/e2e/
docker-compose run e2e-test-server scripts/tests.sh
- name: FIXME make all files in `cache/` readable
# FIXME Workaround for non-readable certs in `cache/josev/[ID]/Josev/iso15118/shared/pki/iso15118_2/certs . See https://github.com/EVerest/everest-core/actions/runs/7286554315/job/19855498928#step:13:10
Expand Down

0 comments on commit 6d4a2e1

Please sign in to comment.