-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SELF_COMMIT_TOKEN
committed
Jun 22, 2023
1 parent
37976ab
commit 6e39a42
Showing
2 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,14 @@ jobs: | |
|
||
id_repo: | ||
runs-on: ubuntu-latest | ||
outputs: { in_base_repo: '${{ steps.identify_repo.outputs.in_base_repo }}' } | ||
steps: | ||
- name: Identify repository | ||
id: identify_repo | ||
run: | | ||
echo "in_base_repo=${{ (github.event_name == 'push' && github.repository == 'Maison-de-la-Simulation/ddc') || github.event.pull_request.head.repo.full_name == 'Maison-de-la-Simulation/ddc' }}" >> "$GITHUB_OUTPUT" | ||
outputs: { in_base_repo: '${{ steps.identify_repo.outputs.in_base_repo }}' } | ||
|
||
docker-build-env: | ||
docker-build: | ||
strategy: | ||
matrix: { image: ['test_env', 'jammy_env'] } | ||
needs: id_repo | ||
|
@@ -63,7 +63,7 @@ jobs: | |
path: ${{matrix.image}}.tar | ||
retention-days: 1 | ||
|
||
test-build-and-run: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -83,7 +83,7 @@ jobs: | |
image: 'jammy_env' | ||
cxx_version: '23' | ||
runs-on: ubuntu-latest | ||
needs: [docker-build-env, id_repo] | ||
needs: [docker-build, id_repo] | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/[email protected] | ||
|
@@ -100,7 +100,8 @@ jobs: | |
run: | | ||
docker load < ${{matrix.image}}.tar | ||
rm ${{matrix.image}}.tar | ||
- name: Build | ||
- name: Test | ||
id: test | ||
run: | | ||
cat<<-'EOF' > run.sh | ||
set -xe | ||
|
@@ -152,4 +153,16 @@ jobs: | |
;; | ||
esac | ||
EOF | ||
docker run -v ${PWD}:/src:ro ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}:${GITHUB_SHA:0:7} bash /src/run.sh | ||
docker run \ | ||
--cidfile='docker.cid' \ | ||
-v ${PWD}:/src:ro ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}:${GITHUB_SHA:0:7} \ | ||
bash /src/run.sh | ||
if docker cp "$(cat docker.cid)":/data/tests.xml /home/runner/work/ddc/ddc/tests.xml | ||
then echo "with_report=true" >> "$GITHUB_OUTPUT" | ||
else echo "with_report=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v3 | ||
if: ( success() || failure() ) && steps.test.outputs.with_report == 'true' # always run even if the previous step fails | ||
with: | ||
report_paths: '/home/runner/work/ddc/ddc/tests.xml' |