From 63c5d61424a402644a7e8c50883bdca4ad94f2b7 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 11:20:50 +0100 Subject: [PATCH 01/45] Only trigger for correct repo --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 022d5cf0d..edbfdb3de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,7 +32,7 @@ jobs: docker/test_env docker push ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/test_env docker-build-jammy_env: @@ -51,7 +51,7 @@ jobs: docker/jammy_env docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env lint: From 516e02b162481a7301d562642d9576e7377bec02 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 13:54:53 +0100 Subject: [PATCH 02/45] Try artifacts --- .github/workflows/tests.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edbfdb3de..52235c2a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,11 +30,18 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/test_env \ -t ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} \ docker/test_env - docker push ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} + ls docker/test_env + #docker push ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/test_env + - name: Save test_env docker + uses: actions/upload-artifact@v3 + with: + name: test_env-artifact + path: docker/test_env/Dockerfile + retention-days: 1 docker-build-jammy_env: runs-on: ubuntu-latest steps: @@ -49,11 +56,18 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/jammy_env \ -t ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} \ docker/jammy_env - docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} + ls + #docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env + - name: Save jammy_env docker + uses: actions/upload-artifact@v3 + with: + name: jammy_env-artifact + path: docker/jammy_env/Dockerfile + retention-days: 1 lint: runs-on: ubuntu-latest steps: @@ -72,6 +86,10 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Collect test_env docker + uses: actions/download-artifact@v3 + with: + name: test_env-artifact - name: Build run: | cat<<-EOF > run.sh @@ -89,6 +107,10 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Collect test_env docker + uses: actions/download-artifact@v3 + with: + name: test_env-artifact - name: Build run: | cat<<-EOF > run.sh @@ -106,6 +128,10 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Collect jammy_env docker + uses: actions/download-artifact@v3 + with: + name: jammy_env-artifact - name: Build run: | cat<<-EOF > run.sh @@ -125,6 +151,10 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Collect test_env docker + uses: actions/download-artifact@v3 + with: + name: test_env-artifact - name: Build run: | cat<<-EOF > run.sh From 77e29da62bd4fd951f5c5ff71684465828d811d4 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 14:00:29 +0100 Subject: [PATCH 03/45] Try artifacts --- .github/workflows/pages.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index aafe57bf3..1b58fc8a1 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -18,11 +18,18 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen - docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} + ls + #docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/doxygen + - name: Save doxygen docker + uses: actions/upload-artifact@v3 + with: + name: doxygen-artifact + path: docker/doxygen/Dockerfile + retention-days: 1 pages: runs-on: ubuntu-latest needs: docker-build @@ -32,6 +39,10 @@ jobs: with: fetch-depth: 0 submodules: true + - name: Collect doxygen docker + uses: actions/download-artifact@v3 + with: + name: doxygen-artifact - name: Build site run: | cat<<-EOF > run.sh From 1bbe813757504eff89f69e0bf09578d873f00994 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 14:11:24 +0100 Subject: [PATCH 04/45] Trigger --- .github/workflows/pages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 1b58fc8a1..a43e1ce72 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,7 +1,6 @@ name: pages on: push: - branches: [ main ] pull_request: jobs: docker-build: From 5450cc28d8ff868d4a53e3e89534d2dd5954db88 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 14:15:10 +0100 Subject: [PATCH 05/45] Correct yml error --- .github/workflows/pages.yml | 4 ++-- .github/workflows/tests.yml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index a43e1ce72..737aa8eb9 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -40,8 +40,8 @@ jobs: submodules: true - name: Collect doxygen docker uses: actions/download-artifact@v3 - with: - name: doxygen-artifact + with: + name: doxygen-artifact - name: Build site run: | cat<<-EOF > run.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 52235c2a5..b97a8013a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -88,8 +88,8 @@ jobs: submodules: recursive - name: Collect test_env docker uses: actions/download-artifact@v3 - with: - name: test_env-artifact + with: + name: test_env-artifact - name: Build run: | cat<<-EOF > run.sh @@ -109,8 +109,8 @@ jobs: submodules: recursive - name: Collect test_env docker uses: actions/download-artifact@v3 - with: - name: test_env-artifact + with: + name: test_env-artifact - name: Build run: | cat<<-EOF > run.sh @@ -130,8 +130,8 @@ jobs: submodules: recursive - name: Collect jammy_env docker uses: actions/download-artifact@v3 - with: - name: jammy_env-artifact + with: + name: jammy_env-artifact - name: Build run: | cat<<-EOF > run.sh @@ -153,8 +153,8 @@ jobs: submodules: recursive - name: Collect test_env docker uses: actions/download-artifact@v3 - with: - name: test_env-artifact + with: + name: test_env-artifact - name: Build run: | cat<<-EOF > run.sh From 832e8d684f8fd2f5edf2d76c4e4f21ecb605ee66 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 14:19:15 +0100 Subject: [PATCH 06/45] Correct ls. Correct run command --- .github/workflows/pages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 737aa8eb9..2addb85d5 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,7 +17,7 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen - ls + ls docker/doxygen #docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} @@ -52,7 +52,7 @@ jobs: EOF mkdir docs_out chmod a+rwx docs_out - docker run -v ${PWD}:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh + docker run -v ${PWD}:/src docker/doxygen bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From ba4a44faac3a145e942d793f320a883423429227 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 14:23:52 +0100 Subject: [PATCH 07/45] Remove debug info --- .github/workflows/pages.yml | 2 -- .github/workflows/tests.yml | 4 ---- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 2addb85d5..4d8292818 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,8 +17,6 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen - ls docker/doxygen - #docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b97a8013a..0f8be1492 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,8 +30,6 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/test_env \ -t ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} \ docker/test_env - ls docker/test_env - #docker push ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | @@ -56,8 +54,6 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/jammy_env \ -t ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} \ docker/jammy_env - ls - #docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | From 6bc476c82df6acdd4e0de509bfd032b8da4f426b Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 15:05:04 +0100 Subject: [PATCH 08/45] Look for artifact --- .github/workflows/pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 4d8292818..0c4f60bba 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -50,6 +50,7 @@ jobs: EOF mkdir docs_out chmod a+rwx docs_out + ls docker/doxygen docker run -v ${PWD}:/src docker/doxygen bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} From 290663eac73f66b9091734d8acab66d0a67781b7 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 15:12:40 +0100 Subject: [PATCH 09/45] Revert change --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0c4f60bba..b79cf5731 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -51,7 +51,7 @@ jobs: mkdir docs_out chmod a+rwx docs_out ls docker/doxygen - docker run -v ${PWD}:/src docker/doxygen bash /src/run.sh + docker run -v ${PWD}:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From 5a13646503a3c7252b562423ce04265f82ad3b46 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 15:13:46 +0100 Subject: [PATCH 10/45] Try better path --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index b79cf5731..d049dac8e 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -51,7 +51,7 @@ jobs: mkdir docs_out chmod a+rwx docs_out ls docker/doxygen - docker run -v ${PWD}:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh + docker run -v ${PWD}/docker/doxygen:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From a39276dc87b55f42f56536ae5f3b6e2f9f3c8e80 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 15:30:21 +0100 Subject: [PATCH 11/45] Ignore tag --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d049dac8e..979d0bbb1 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -51,7 +51,7 @@ jobs: mkdir docs_out chmod a+rwx docs_out ls docker/doxygen - docker run -v ${PWD}/docker/doxygen:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh + docker run -v ${PWD}/docker/doxygen:/src bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From a8756e9aca316e508a03e66ab0161b1f936d02b6 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Mon, 12 Dec 2022 15:33:24 +0100 Subject: [PATCH 12/45] Try --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 979d0bbb1..9a07d2ab0 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -51,7 +51,7 @@ jobs: mkdir docs_out chmod a+rwx docs_out ls docker/doxygen - docker run -v ${PWD}/docker/doxygen:/src bash /src/run.sh + docker run ${PWD}/docker/doxygen bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From 7ff925290411ca304ab3a6f517c6cabd1860ae5b Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Tue, 13 Dec 2022 17:05:38 +0100 Subject: [PATCH 13/45] Try out export command --- .github/workflows/pages.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 9a07d2ab0..18f140a17 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,6 +17,10 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen + docker export docker/doxygen + ls + ls docker + ls docker/doxygen - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From 655eff41f146cf3ab674fc91fb45fc02d3beb61d Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Tue, 13 Dec 2022 17:22:48 +0100 Subject: [PATCH 14/45] List containers --- .github/workflows/pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 18f140a17..45b621767 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,6 +17,7 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen + docker ps -a docker export docker/doxygen ls ls docker From e53a3e55440a8210f675ebafef431b88360c4c20 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Tue, 13 Dec 2022 17:26:12 +0100 Subject: [PATCH 15/45] Run to create container? --- .github/workflows/pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 45b621767..e87f88adc 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,6 +17,7 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen + docker run -v ${PWD}:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh docker ps -a docker export docker/doxygen ls From 1dce8a6f8523264d905d22ebea25972a85eeb46e Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:21:02 +0100 Subject: [PATCH 16/45] Examine images --- .github/workflows/pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index e87f88adc..c2715fb08 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -19,6 +19,7 @@ jobs: docker/doxygen docker run -v ${PWD}:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh docker ps -a + docker images docker export docker/doxygen ls ls docker From df066a01ac3a97fd033a1af17adf8fb54d6837f7 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:29:34 +0100 Subject: [PATCH 17/45] Remove broken line --- .github/workflows/pages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index c2715fb08..d6abe55b6 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,7 +17,6 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen - docker run -v ${PWD}:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh docker ps -a docker images docker export docker/doxygen From 9ab89d5c25f0092e95cb1acf5e7c2cc35f137df7 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:36:51 +0100 Subject: [PATCH 18/45] Aim to use save --- .github/workflows/pages.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d6abe55b6..2bc09efd8 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,9 +17,8 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen - docker ps -a - docker images - docker export docker/doxygen + docker images ls + docker save docker/doxygen > doxygen.tar ls ls docker ls docker/doxygen @@ -31,7 +30,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: doxygen-artifact - path: docker/doxygen/Dockerfile + path: doxygen.tar retention-days: 1 pages: runs-on: ubuntu-latest From ec12396e4bcdac3c55764ea2df84c09f0291a15a Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:39:08 +0100 Subject: [PATCH 19/45] Change command --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 2bc09efd8..ee8bd6c6c 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,7 +17,7 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen - docker images ls + docker images docker/doxygen docker save docker/doxygen > doxygen.tar ls ls docker From 2e5717ed260cf5a2b4cd1d8c2aec9703656cb150 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:41:49 +0100 Subject: [PATCH 20/45] Examine --- .github/workflows/pages.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ee8bd6c6c..523a4f301 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,7 +17,12 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen - docker images docker/doxygen + docker images + cd docker + docker images + cd doxygen + docker images + cd ../.. docker save docker/doxygen > doxygen.tar ls ls docker From e1a6d80723918e262168804a331b3a0843c113ab Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:45:21 +0100 Subject: [PATCH 21/45] Testing --- .github/workflows/pages.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 523a4f301..7222b1540 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,13 +17,14 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen + docker build --tag my_test docker/doxygen docker images cd docker docker images cd doxygen docker images cd ../.. - docker save docker/doxygen > doxygen.tar + docker save ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} > doxygen.tar ls ls docker ls docker/doxygen From 83a822a94bb29fdb74d1ffac64767dacf409d7a7 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:48:50 +0100 Subject: [PATCH 22/45] Comment --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7222b1540..b2a78a1ba 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,7 +17,7 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ docker/doxygen - docker build --tag my_test docker/doxygen + #docker build --tag my_test docker/doxygen docker images cd docker docker images From 10a5b3b2a4b3818553e1feeb8bf45e00ddc9df50 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:49:05 +0100 Subject: [PATCH 23/45] Examine --- .github/workflows/pages.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index b2a78a1ba..5c566b99a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -12,12 +12,12 @@ jobs: run: | echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin docker pull ghcr.io/maison-de-la-simulation/ddc/doxygen || true - docker build \ - --cache-from ghcr.io/maison-de-la-simulation/ddc/doxygen \ - -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ - -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ - docker/doxygen - #docker build --tag my_test docker/doxygen + #docker build \ + # --cache-from ghcr.io/maison-de-la-simulation/ddc/doxygen \ + # -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ + # -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ + # docker/doxygen + docker build --tag my_test docker/doxygen docker images cd docker docker images From d11d17b1d13c5baf0cb7e9701eb71299398966cc Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 08:56:13 +0100 Subject: [PATCH 24/45] Load tarball --- .github/workflows/pages.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 5c566b99a..736b4700a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -12,22 +12,12 @@ jobs: run: | echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin docker pull ghcr.io/maison-de-la-simulation/ddc/doxygen || true - #docker build \ - # --cache-from ghcr.io/maison-de-la-simulation/ddc/doxygen \ - # -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ - # -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ - # docker/doxygen - docker build --tag my_test docker/doxygen - docker images - cd docker - docker images - cd doxygen - docker images - cd ../.. + docker build \ + --cache-from ghcr.io/maison-de-la-simulation/ddc/doxygen \ + -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ + -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ + docker/doxygen docker save ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} > doxygen.tar - ls - ls docker - ls docker/doxygen - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | @@ -53,6 +43,7 @@ jobs: name: doxygen-artifact - name: Build site run: | + docker load < doxygen.tar cat<<-EOF > run.sh set -xe cmake -DBUILD_DOCUMENTATION=ON -DDDC_BUILD_PDI_WRAPPER=OFF /src @@ -61,7 +52,6 @@ jobs: EOF mkdir docs_out chmod a+rwx docs_out - ls docker/doxygen docker run ${PWD}/docker/doxygen bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} From c5a903401fa81db167bbeecab02182159c0a3a9e Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 09:08:47 +0100 Subject: [PATCH 25/45] Try lower case --- .github/workflows/pages.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 736b4700a..44fd3198f 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -52,7 +52,8 @@ jobs: EOF mkdir docs_out chmod a+rwx docs_out - docker run ${PWD}/docker/doxygen bash /src/run.sh + echo ${PWD}/docker/doxygen + docker run ${pwd}/docker/doxygen bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From 0ddadde232cd5618f5089e85946f0fd63c03f935 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 09:22:47 +0100 Subject: [PATCH 26/45] Try clearer name --- .github/workflows/pages.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 44fd3198f..ccb0b284b 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -16,8 +16,9 @@ jobs: --cache-from ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ + -t doxygen_image docker/doxygen - docker save ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} > doxygen.tar + docker save doxygen_image > doxygen.tar - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | @@ -53,7 +54,7 @@ jobs: mkdir docs_out chmod a+rwx docs_out echo ${PWD}/docker/doxygen - docker run ${pwd}/docker/doxygen bash /src/run.sh + docker run doxygen_image bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From df91d34c499c9fec7ee3e73614af929850dacdae Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 09:24:58 +0100 Subject: [PATCH 27/45] Missing line continuation --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ccb0b284b..d1546fd3c 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -16,7 +16,7 @@ jobs: --cache-from ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen \ -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ - -t doxygen_image + -t doxygen_image \ docker/doxygen docker save doxygen_image > doxygen.tar - name: Publish From 0a8001ddcc564b0db6b28666dab3833198eafb8d Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 09:35:16 +0100 Subject: [PATCH 28/45] Return closer to original command --- .github/workflows/pages.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d1546fd3c..7d6189503 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -53,8 +53,7 @@ jobs: EOF mkdir docs_out chmod a+rwx docs_out - echo ${PWD}/docker/doxygen - docker run doxygen_image bash /src/run.sh + docker run -v ${PWD}:/src doxygen_image bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | From 3b9ace8dc5890284a3129527fa41a37186aafb2f Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 09:50:32 +0100 Subject: [PATCH 29/45] Use strategy for tests --- .github/workflows/tests.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0f8be1492..c4b1554ba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,9 @@ jobs: --cache-from ghcr.io/maison-de-la-simulation/ddc/test_env \ -t ghcr.io/maison-de-la-simulation/ddc/test_env \ -t ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} \ + -t test_env_image \ docker/test_env + docker save test_env_image > test_env.tar - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | @@ -38,7 +40,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: test_env-artifact - path: docker/test_env/Dockerfile + path: test_env.tar retention-days: 1 docker-build-jammy_env: runs-on: ubuntu-latest @@ -53,7 +55,9 @@ jobs: --cache-from ghcr.io/maison-de-la-simulation/ddc/jammy_env \ -t ghcr.io/maison-de-la-simulation/ddc/jammy_env \ -t ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} \ + -t jammy_env_image \ docker/jammy_env + docker save jammy_env_image > jammy_env.tar - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | @@ -62,7 +66,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: jammy_env-artifact - path: docker/jammy_env/Dockerfile + path: jammy_env.tar retention-days: 1 lint: runs-on: ubuntu-latest @@ -88,13 +92,14 @@ jobs: name: test_env-artifact - name: Build run: | + docker load < test_env.tar cat<<-EOF > run.sh set -xe cmake -DCMAKE_CXX_FLAGS="-Wall -fno-omit-frame-pointer -fsanitize=address" -DBUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF /src make -j 2 VERBOSE=1 ctest -j 2 --output-on-failure --timeout 5 --output-junit tests.xml EOF - docker run -v ${PWD}:/src:ro ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} bash /src/run.sh + docker run -v ${PWD}:/src:ro test_env_image bash /src/run.sh test-Release: runs-on: ubuntu-latest needs: docker-build-test_env @@ -109,13 +114,14 @@ jobs: name: test_env-artifact - name: Build run: | + docker load < test_env.tar cat<<-EOF > run.sh set -xe cmake -DCMAKE_CXX_FLAGS="-Wall" -DBUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release /src make -j 2 VERBOSE=1 ctest -j 2 --output-on-failure --timeout 5 --output-junit tests.xml EOF - docker run -v ${PWD}:/src:ro ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} bash /src/run.sh + docker run -v ${PWD}:/src:ro test_env_image bash /src/run.sh test-cuda: runs-on: ubuntu-latest needs: docker-build-jammy_env @@ -130,6 +136,7 @@ jobs: name: jammy_env-artifact - name: Build run: | + docker load < jammy_env.tar cat<<-EOF > run.sh set -xe export CC=gcc-10 @@ -138,7 +145,7 @@ jobs: cmake -DCMAKE_CXX_FLAGS="-Wall" -DBUILD_BENCHMARKS=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_VOLTA70=ON -DKokkos_ENABLE_LIBDL=OFF -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF /src make -j 2 VERBOSE=1 EOF - docker run -v ${PWD}:/src:ro ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} bash /src/run.sh + docker run -v ${PWD}:/src:ro jammy_env_image bash /src/run.sh test-hip: runs-on: ubuntu-latest needs: docker-build-test_env @@ -153,6 +160,7 @@ jobs: name: test_env-artifact - name: Build run: | + docker load < test_env.tar cat<<-EOF > run.sh set -xe export CC=/opt/rocm/hip/bin/hipcc @@ -160,4 +168,4 @@ jobs: cmake -DCMAKE_CXX_FLAGS="-Wall" -DBUILD_BENCHMARKS=ON -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA900=ON -DCMAKE_PREFIX_PATH=/opt/rocm -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF /src make -j 2 VERBOSE=1 EOF - docker run -v ${PWD}:/src:ro ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} bash /src/run.sh + docker run -v ${PWD}:/src:ro test_env_image bash /src/run.sh From e9a5073b012077b1edc5cd564c6d3b514df5c276 Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Wed, 14 Dec 2022 13:46:12 +0100 Subject: [PATCH 30/45] Try to be more agressive --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c4b1554ba..45b847c6c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: android: true dotnet: true haskell: true - large-packages: false + large-packages: true swap-storage: true - name: Checkout built branch uses: actions/checkout@v3 From d2d1f6de767fa706b8ba9999e33cb26c5a5eb81a Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Fri, 16 Dec 2022 13:37:15 +0100 Subject: [PATCH 31/45] Disk space --- .github/workflows/tests.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 45b847c6c..32effec11 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -108,6 +108,18 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true - name: Collect test_env docker uses: actions/download-artifact@v3 with: @@ -130,6 +142,18 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true - name: Collect jammy_env docker uses: actions/download-artifact@v3 with: @@ -154,6 +178,18 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true - name: Collect test_env docker uses: actions/download-artifact@v3 with: From f0371b3b500a5f700efe597ae758a799e653285b Mon Sep 17 00:00:00 2001 From: EmilyBoune Date: Fri, 16 Dec 2022 14:43:29 +0100 Subject: [PATCH 32/45] Add missed disk space --- .github/workflows/tests.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32effec11..32e57340f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,6 +86,18 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true - name: Collect test_env docker uses: actions/download-artifact@v3 with: From 5485cb07ff5cdf575f1b3bde9a4260e9bfb6a965 Mon Sep 17 00:00:00 2001 From: EmilyBourne Date: Thu, 16 Mar 2023 17:17:50 +0100 Subject: [PATCH 33/45] Revert unnecessary change --- .github/workflows/pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7d6189503..21b9b245b 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,6 +1,7 @@ name: pages on: push: + branches: [ main ] pull_request: jobs: docker-build: From 8622925ad446cd70767c0d643a0745b379479a44 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 09:13:10 +0200 Subject: [PATCH 34/45] Use ifs to treat different cases --- .github/workflows/pages.yml | 26 +++++++++++++-- .github/workflows/tests.yml | 66 ++++++++++++++++++++++++++++++++----- 2 files changed, 81 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 21b9b245b..669a1e3e3 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -6,6 +6,8 @@ on: jobs: docker-build: runs-on: ubuntu-latest + outputs: + doxygen_image: ${{ steps.image_output.outputs.doxygen_image }} steps: - name: Checkout built branch uses: actions/checkout@v3 @@ -19,17 +21,31 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ -t doxygen_image \ docker/doxygen + - name: Publish doxygen artifact for current SHA + if: ${{ github.repository == Maison-de-la-Simulation/ddc }} + run: | + echo "doxygen_image=ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7}" >> $GITHUB_ENV + docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} + - name: Create doxygen docker artifact + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + run: | + echo "doxygen_image=doxygen_image" >> $GITHUB_ENV docker save doxygen_image > doxygen.tar - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/doxygen - name: Save doxygen docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} uses: actions/upload-artifact@v3 with: name: doxygen-artifact path: doxygen.tar retention-days: 1 + - name: Output image + id: image_output + run: | + echo "doxygen_image=${doxygen_image}" >> "$GITHUB_OUTPUT" pages: runs-on: ubuntu-latest needs: docker-build @@ -40,12 +56,16 @@ jobs: fetch-depth: 0 submodules: true - name: Collect doxygen docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} uses: actions/download-artifact@v3 with: name: doxygen-artifact - - name: Build site + - name: Load doxygen docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} run: | docker load < doxygen.tar + - name: Build site + run: | cat<<-EOF > run.sh set -xe cmake -DBUILD_DOCUMENTATION=ON -DDDC_BUILD_PDI_WRAPPER=OFF /src @@ -54,7 +74,7 @@ jobs: EOF mkdir docs_out chmod a+rwx docs_out - docker run -v ${PWD}:/src doxygen_image bash /src/run.sh + docker run -v ${PWD}:/src ${{ needs.docker-build.outputs.doxygen_image }} bash /src/run.sh - name: Publish site if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32e57340f..e10cdde78 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,8 @@ on: jobs: docker-build-test_env: runs-on: ubuntu-latest + outputs: + test_env_image: ${{ steps.image_output.outputs.test_env_image }} steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -31,19 +33,36 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} \ -t test_env_image \ docker/test_env + - name: Publish test_env artifact for current SHA + if: ${{ github.repository == Maison-de-la-Simulation/ddc }} + run: | + echo "test_env_image=ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7}" >> $GITHUB_ENV + docker push ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} + - name: Create test_env docker artifact + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + run: | + echo "test_env_image=test_env_image" >> $GITHUB_ENV docker save test_env_image > test_env.tar - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/test_env - name: Save test_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} uses: actions/upload-artifact@v3 with: name: test_env-artifact path: test_env.tar retention-days: 1 + - name: Output image + id: image_output + run: | + echo "test_env_image=${test_env_image}" >> "$GITHUB_OUTPUT" + docker-build-jammy_env: runs-on: ubuntu-latest + outputs: + jammy_image: ${{ steps.image_output.outputs.jammy_image }} steps: - name: Checkout built branch uses: actions/checkout@v3 @@ -57,17 +76,32 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} \ -t jammy_env_image \ docker/jammy_env + - name: Publish jammy_env artifact for current SHA + if: ${{ github.repository == Maison-de-la-Simulation/ddc }} + run: | + echo "jammy_image=ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7}" >> $GITHUB_ENV + docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} + - name: Create jammy_env artifact + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + run: | + echo "jammy_image=jammy_env_image" >> $GITHUB_ENV docker save jammy_env_image > jammy_env.tar - name: Publish if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env - name: Save jammy_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} uses: actions/upload-artifact@v3 with: name: jammy_env-artifact path: jammy_env.tar retention-days: 1 + - name: Output image + id: image_output + run: | + echo "jammy_image=${jammy_image}" >> "$GITHUB_OUTPUT" + lint: runs-on: ubuntu-latest steps: @@ -99,19 +133,23 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} uses: actions/download-artifact@v3 with: name: test_env-artifact - - name: Build + - name: Load test_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} run: | docker load < test_env.tar + - name: Build + run: | cat<<-EOF > run.sh set -xe cmake -DCMAKE_CXX_FLAGS="-Wall -fno-omit-frame-pointer -fsanitize=address" -DBUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF /src make -j 2 VERBOSE=1 ctest -j 2 --output-on-failure --timeout 5 --output-junit tests.xml EOF - docker run -v ${PWD}:/src:ro test_env_image bash /src/run.sh + docker run -v ${PWD}:/src:ro ${{ needs.docker-build-test_env.outputs.test_env_image }} bash /src/run.sh test-Release: runs-on: ubuntu-latest needs: docker-build-test_env @@ -133,19 +171,23 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} uses: actions/download-artifact@v3 with: name: test_env-artifact - - name: Build + - name: Load test_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} run: | docker load < test_env.tar + - name: Build + run: | cat<<-EOF > run.sh set -xe cmake -DCMAKE_CXX_FLAGS="-Wall" -DBUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release /src make -j 2 VERBOSE=1 ctest -j 2 --output-on-failure --timeout 5 --output-junit tests.xml EOF - docker run -v ${PWD}:/src:ro test_env_image bash /src/run.sh + docker run -v ${PWD}:/src:ro ${{ needs.docker-build-test_env.outputs.test_env_image }} bash /src/run.sh test-cuda: runs-on: ubuntu-latest needs: docker-build-jammy_env @@ -167,12 +209,16 @@ jobs: large-packages: true swap-storage: true - name: Collect jammy_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} uses: actions/download-artifact@v3 with: name: jammy_env-artifact - - name: Build + - name: Load jammy_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} run: | docker load < jammy_env.tar + - name: Build + run: | cat<<-EOF > run.sh set -xe export CC=gcc-10 @@ -181,7 +227,7 @@ jobs: cmake -DCMAKE_CXX_FLAGS="-Wall" -DBUILD_BENCHMARKS=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_VOLTA70=ON -DKokkos_ENABLE_LIBDL=OFF -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF /src make -j 2 VERBOSE=1 EOF - docker run -v ${PWD}:/src:ro jammy_env_image bash /src/run.sh + docker run -v ${PWD}:/src:ro ${{ needs.docker-build-jammy_env.outputs.jammy_image }} bash /src/run.sh test-hip: runs-on: ubuntu-latest needs: docker-build-test_env @@ -203,12 +249,16 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} uses: actions/download-artifact@v3 with: name: test_env-artifact - - name: Build + - name: Load test_env docker + if: ${{ github.repository != Maison-de-la-Simulation/ddc }} run: | docker load < test_env.tar + - name: Build + run: | cat<<-EOF > run.sh set -xe export CC=/opt/rocm/hip/bin/hipcc @@ -216,4 +266,4 @@ jobs: cmake -DCMAKE_CXX_FLAGS="-Wall" -DBUILD_BENCHMARKS=ON -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA900=ON -DCMAKE_PREFIX_PATH=/opt/rocm -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF /src make -j 2 VERBOSE=1 EOF - docker run -v ${PWD}:/src:ro test_env_image bash /src/run.sh + docker run -v ${PWD}:/src:ro ${{ needs.docker-build-test_env.outputs.test_env_image }} bash /src/run.sh From a74ba1c08e9ca60ba838e8a4fd1a6aa1f9027e6d Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 09:31:15 +0200 Subject: [PATCH 35/45] Missing quotes --- .github/workflows/pages.yml | 10 +++++----- .github/workflows/tests.yml | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 669a1e3e3..aa7c64c8b 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -22,12 +22,12 @@ jobs: -t doxygen_image \ docker/doxygen - name: Publish doxygen artifact for current SHA - if: ${{ github.repository == Maison-de-la-Simulation/ddc }} + if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} run: | echo "doxygen_image=ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} - name: Create doxygen docker artifact - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} run: | echo "doxygen_image=doxygen_image" >> $GITHUB_ENV docker save doxygen_image > doxygen.tar @@ -36,7 +36,7 @@ jobs: run: | docker push ghcr.io/maison-de-la-simulation/ddc/doxygen - name: Save doxygen docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} uses: actions/upload-artifact@v3 with: name: doxygen-artifact @@ -56,12 +56,12 @@ jobs: fetch-depth: 0 submodules: true - name: Collect doxygen docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} uses: actions/download-artifact@v3 with: name: doxygen-artifact - name: Load doxygen docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} run: | docker load < doxygen.tar - name: Build site diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e10cdde78..98ad601ce 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,12 +34,12 @@ jobs: -t test_env_image \ docker/test_env - name: Publish test_env artifact for current SHA - if: ${{ github.repository == Maison-de-la-Simulation/ddc }} + if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} run: | echo "test_env_image=ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} - name: Create test_env docker artifact - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} run: | echo "test_env_image=test_env_image" >> $GITHUB_ENV docker save test_env_image > test_env.tar @@ -48,7 +48,7 @@ jobs: run: | docker push ghcr.io/maison-de-la-simulation/ddc/test_env - name: Save test_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} uses: actions/upload-artifact@v3 with: name: test_env-artifact @@ -77,12 +77,12 @@ jobs: -t jammy_env_image \ docker/jammy_env - name: Publish jammy_env artifact for current SHA - if: ${{ github.repository == Maison-de-la-Simulation/ddc }} + if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} run: | echo "jammy_image=ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} - name: Create jammy_env artifact - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} run: | echo "jammy_image=jammy_env_image" >> $GITHUB_ENV docker save jammy_env_image > jammy_env.tar @@ -91,7 +91,7 @@ jobs: run: | docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env - name: Save jammy_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} uses: actions/upload-artifact@v3 with: name: jammy_env-artifact @@ -133,12 +133,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} run: | docker load < test_env.tar - name: Build @@ -171,12 +171,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} run: | docker load < test_env.tar - name: Build @@ -209,12 +209,12 @@ jobs: large-packages: true swap-storage: true - name: Collect jammy_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} uses: actions/download-artifact@v3 with: name: jammy_env-artifact - name: Load jammy_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} run: | docker load < jammy_env.tar - name: Build @@ -249,12 +249,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ github.repository != Maison-de-la-Simulation/ddc }} + if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} run: | docker load < test_env.tar - name: Build From ba8cacbc7f710050a3265810aed61891d956718e Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 09:35:31 +0200 Subject: [PATCH 36/45] Print values --- .github/workflows/pages.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index aa7c64c8b..ca3c88db0 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -21,6 +21,10 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ -t doxygen_image \ docker/doxygen + echo "${{ github.repository }}" + echo "${{ github.organization }}" + echo "${{ github.sender }}" + echo "${{ github.pull_request.head.repo }}" - name: Publish doxygen artifact for current SHA if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} run: | From 3fb00fd00279ff323fb16ad7bd854825cea88d83 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 09:38:39 +0200 Subject: [PATCH 37/45] Print values --- .github/workflows/pages.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ca3c88db0..7fe20cbae 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -22,9 +22,10 @@ jobs: -t doxygen_image \ docker/doxygen echo "${{ github.repository }}" - echo "${{ github.organization }}" - echo "${{ github.sender }}" - echo "${{ github.pull_request.head.repo }}" + echo "${{ github.event.repository }}" + echo "${{ github.event.organization }}" + echo "${{ github.event.sender }}" + echo "${{ github.event.pull_request.head.repo }}" - name: Publish doxygen artifact for current SHA if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} run: | From 54a7884ee3719a17c447571a80f88bd92c9dce77 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 09:44:00 +0200 Subject: [PATCH 38/45] Print names --- .github/workflows/pages.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7fe20cbae..8a6503c52 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -22,10 +22,10 @@ jobs: -t doxygen_image \ docker/doxygen echo "${{ github.repository }}" - echo "${{ github.event.repository }}" - echo "${{ github.event.organization }}" - echo "${{ github.event.sender }}" - echo "${{ github.event.pull_request.head.repo }}" + echo "${{ github.event.repository.name }}" + echo "${{ github.event.organization.name }}" + echo "${{ github.event.sender.name }}" + echo "${{ github.event.pull_request.head.repo.name }}" - name: Publish doxygen artifact for current SHA if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} run: | From fc16c9de1afe18922bd14e049eef1ea7c7220e34 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 09:46:46 +0200 Subject: [PATCH 39/45] Print full names --- .github/workflows/pages.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 8a6503c52..5fd5d520c 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -22,10 +22,8 @@ jobs: -t doxygen_image \ docker/doxygen echo "${{ github.repository }}" - echo "${{ github.event.repository.name }}" - echo "${{ github.event.organization.name }}" - echo "${{ github.event.sender.name }}" - echo "${{ github.event.pull_request.head.repo.name }}" + echo "${{ github.event.repository.full_name }}" + echo "${{ github.event.pull_request.head.repo.full_name }}" - name: Publish doxygen artifact for current SHA if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} run: | From 734b258582f55433fa3a0f22359457b431874bf7 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 09:51:13 +0200 Subject: [PATCH 40/45] Test run on push --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 5fd5d520c..bbb114346 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,7 +1,7 @@ name: pages on: push: - branches: [ main ] + branches: [ main, 106-docker-artifact ] pull_request: jobs: docker-build: From 4a3ef0eeab1df746439360e4587c3c66e6746c0e Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 10:19:18 +0200 Subject: [PATCH 41/45] Simplify and reduce duplication --- .github/workflows/pages.yml | 32 +++++++++++++-------- .github/workflows/tests.yml | 57 ++++++++++++++++++++++++------------- 2 files changed, 57 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index bbb114346..ccbd47faa 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,10 +1,21 @@ name: pages on: push: - branches: [ main, 106-docker-artifact ] + branches: [ Maison-de-la-Simulation/ddc/main, 106-docker-artifact ] pull_request: 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 == 'push' && github.repository == 'Maison-de-la-Simulation/ddc') || github.event.pull_request.head.repo.full_name == 'Maison-de-la-Simulation/ddc' }}" >> "$GITHUB_OUTPUT" + echo "$GITHUB_OUTPUT" docker-build: + needs: id_repo runs-on: ubuntu-latest outputs: doxygen_image: ${{ steps.image_output.outputs.doxygen_image }} @@ -21,25 +32,22 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ -t doxygen_image \ docker/doxygen - echo "${{ github.repository }}" - echo "${{ github.event.repository.full_name }}" - echo "${{ github.event.pull_request.head.repo.full_name }}" - name: Publish doxygen artifact for current SHA - if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} + if: ${{ needs.id_repo.outputs.in_base_repo }} run: | echo "doxygen_image=ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} - name: Create doxygen docker artifact - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} run: | echo "doxygen_image=doxygen_image" >> $GITHUB_ENV docker save doxygen_image > doxygen.tar - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/doxygen - name: Save doxygen docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} uses: actions/upload-artifact@v3 with: name: doxygen-artifact @@ -51,7 +59,7 @@ jobs: echo "doxygen_image=${doxygen_image}" >> "$GITHUB_OUTPUT" pages: runs-on: ubuntu-latest - needs: docker-build + needs: [docker-build, id_repo] steps: - name: Checkout built branch uses: actions/checkout@v3 @@ -59,12 +67,12 @@ jobs: fetch-depth: 0 submodules: true - name: Collect doxygen docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} uses: actions/download-artifact@v3 with: name: doxygen-artifact - name: Load doxygen docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} run: | docker load < doxygen.tar - name: Build site @@ -79,7 +87,7 @@ jobs: chmod a+rwx docs_out docker run -v ${PWD}:/src ${{ needs.docker-build.outputs.doxygen_image }} bash /src/run.sh - name: Publish site - if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo }} run: | git worktree add -B gh-pages public remotes/origin/gh-pages find public -mindepth 1 -maxdepth 1 '!' -name .git -exec rm -rf '{}' '+' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 98ad601ce..e1d98905a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,19 @@ on: branches: [ main ] pull_request: 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 == 'push' && github.repository == 'Maison-de-la-Simulation/ddc') || github.event.pull_request.head.repo.full_name == 'Maison-de-la-Simulation/ddc' }}" >> "$GITHUB_OUTPUT" + echo "$GITHUB_OUTPUT" + docker-build-test_env: + needs: id_repo runs-on: ubuntu-latest outputs: test_env_image: ${{ steps.image_output.outputs.test_env_image }} @@ -34,21 +46,21 @@ jobs: -t test_env_image \ docker/test_env - name: Publish test_env artifact for current SHA - if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} + if: ${{ needs.id_repo.outputs.in_base_repo }} run: | echo "test_env_image=ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} - name: Create test_env docker artifact - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} run: | echo "test_env_image=test_env_image" >> $GITHUB_ENV docker save test_env_image > test_env.tar - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/test_env - name: Save test_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} uses: actions/upload-artifact@v3 with: name: test_env-artifact @@ -60,6 +72,7 @@ jobs: echo "test_env_image=${test_env_image}" >> "$GITHUB_OUTPUT" docker-build-jammy_env: + needs: id_repo runs-on: ubuntu-latest outputs: jammy_image: ${{ steps.image_output.outputs.jammy_image }} @@ -77,21 +90,21 @@ jobs: -t jammy_env_image \ docker/jammy_env - name: Publish jammy_env artifact for current SHA - if: ${{ github.repository == 'Maison-de-la-Simulation/ddc' }} + if: ${{ needs.id_repo.outputs.in_base_repo }} run: | echo "jammy_image=ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} - name: Create jammy_env artifact - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} run: | echo "jammy_image=jammy_env_image" >> $GITHUB_ENV docker save jammy_env_image > jammy_env.tar - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'Maison-de-la-Simulation/ddc' }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env - name: Save jammy_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} uses: actions/upload-artifact@v3 with: name: jammy_env-artifact @@ -112,9 +125,10 @@ jobs: exclude: '' extensions: 'hpp,cpp' clangFormatVersion: 12 + test-Debug: runs-on: ubuntu-latest - needs: docker-build-test_env + needs: [docker-build-test_env, id_repo] steps: - name: Checkout built branch uses: actions/checkout@v3 @@ -133,12 +147,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} run: | docker load < test_env.tar - name: Build @@ -150,9 +164,10 @@ jobs: ctest -j 2 --output-on-failure --timeout 5 --output-junit tests.xml EOF docker run -v ${PWD}:/src:ro ${{ needs.docker-build-test_env.outputs.test_env_image }} bash /src/run.sh + test-Release: runs-on: ubuntu-latest - needs: docker-build-test_env + needs: [docker-build-test_env, id_repo] steps: - name: Checkout built branch uses: actions/checkout@v3 @@ -171,12 +186,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} run: | docker load < test_env.tar - name: Build @@ -188,9 +203,10 @@ jobs: ctest -j 2 --output-on-failure --timeout 5 --output-junit tests.xml EOF docker run -v ${PWD}:/src:ro ${{ needs.docker-build-test_env.outputs.test_env_image }} bash /src/run.sh + test-cuda: runs-on: ubuntu-latest - needs: docker-build-jammy_env + needs: [docker-build-jammy_env, id_repo] steps: - name: Checkout built branch uses: actions/checkout@v3 @@ -209,12 +225,12 @@ jobs: large-packages: true swap-storage: true - name: Collect jammy_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} uses: actions/download-artifact@v3 with: name: jammy_env-artifact - name: Load jammy_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} run: | docker load < jammy_env.tar - name: Build @@ -228,9 +244,10 @@ jobs: make -j 2 VERBOSE=1 EOF docker run -v ${PWD}:/src:ro ${{ needs.docker-build-jammy_env.outputs.jammy_image }} bash /src/run.sh + test-hip: runs-on: ubuntu-latest - needs: docker-build-test_env + needs: [docker-build-test_env, id_repo] steps: - name: Checkout built branch uses: actions/checkout@v3 @@ -249,12 +266,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ github.repository != 'Maison-de-la-Simulation/ddc' }} + if: ${{ ! needs.id_repo.outputs.in_base_repo }} run: | docker load < test_env.tar - name: Build From d8305165657b3f73735dab5426ebbc254f0361e3 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 10:21:23 +0200 Subject: [PATCH 42/45] Examine --- .github/workflows/pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ccbd47faa..f482d6b9c 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -32,6 +32,7 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ -t doxygen_image \ docker/doxygen + echo "${{ needs.id_repo.outputs.in_base_repo }}" - name: Publish doxygen artifact for current SHA if: ${{ needs.id_repo.outputs.in_base_repo }} run: | From c83dbe5e2eef2384c75de9a648a06cf167e7a46e Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 10:24:38 +0200 Subject: [PATCH 43/45] Correct comparison --- .github/workflows/pages.yml | 15 +++++++-------- .github/workflows/tests.yml | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index f482d6b9c..2e5d6b1c3 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -32,23 +32,22 @@ jobs: -t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \ -t doxygen_image \ docker/doxygen - echo "${{ needs.id_repo.outputs.in_base_repo }}" - name: Publish doxygen artifact for current SHA - if: ${{ needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'true' }} run: | echo "doxygen_image=ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} - name: Create doxygen docker artifact - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} run: | echo "doxygen_image=doxygen_image" >> $GITHUB_ENV docker save doxygen_image > doxygen.tar - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo == 'true' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/doxygen - name: Save doxygen docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} uses: actions/upload-artifact@v3 with: name: doxygen-artifact @@ -68,12 +67,12 @@ jobs: fetch-depth: 0 submodules: true - name: Collect doxygen docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} uses: actions/download-artifact@v3 with: name: doxygen-artifact - name: Load doxygen docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} run: | docker load < doxygen.tar - name: Build site @@ -88,7 +87,7 @@ jobs: chmod a+rwx docs_out docker run -v ${PWD}:/src ${{ needs.docker-build.outputs.doxygen_image }} bash /src/run.sh - name: Publish site - if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo == 'true' }} run: | git worktree add -B gh-pages public remotes/origin/gh-pages find public -mindepth 1 -maxdepth 1 '!' -name .git -exec rm -rf '{}' '+' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e1d98905a..d0dcaa224 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,21 +46,21 @@ jobs: -t test_env_image \ docker/test_env - name: Publish test_env artifact for current SHA - if: ${{ needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'true' }} run: | echo "test_env_image=ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/test_env:${GITHUB_SHA:0:7} - name: Create test_env docker artifact - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} run: | echo "test_env_image=test_env_image" >> $GITHUB_ENV docker save test_env_image > test_env.tar - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo == 'true' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/test_env - name: Save test_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} uses: actions/upload-artifact@v3 with: name: test_env-artifact @@ -90,21 +90,21 @@ jobs: -t jammy_env_image \ docker/jammy_env - name: Publish jammy_env artifact for current SHA - if: ${{ needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'true' }} run: | echo "jammy_image=ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7}" >> $GITHUB_ENV docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env:${GITHUB_SHA:0:7} - name: Create jammy_env artifact - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} run: | echo "jammy_image=jammy_env_image" >> $GITHUB_ENV docker save jammy_env_image > jammy_env.tar - name: Publish - if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo }} + if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo == 'true' }} run: | docker push ghcr.io/maison-de-la-simulation/ddc/jammy_env - name: Save jammy_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} uses: actions/upload-artifact@v3 with: name: jammy_env-artifact @@ -147,12 +147,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} run: | docker load < test_env.tar - name: Build @@ -186,12 +186,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} run: | docker load < test_env.tar - name: Build @@ -225,12 +225,12 @@ jobs: large-packages: true swap-storage: true - name: Collect jammy_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} uses: actions/download-artifact@v3 with: name: jammy_env-artifact - name: Load jammy_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} run: | docker load < jammy_env.tar - name: Build @@ -266,12 +266,12 @@ jobs: large-packages: true swap-storage: true - name: Collect test_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} uses: actions/download-artifact@v3 with: name: test_env-artifact - name: Load test_env docker - if: ${{ ! needs.id_repo.outputs.in_base_repo }} + if: ${{ needs.id_repo.outputs.in_base_repo == 'false' }} run: | docker load < test_env.tar - name: Build From 6da34d984f4fc973d79c70c0e4711a283842620b Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 10:25:58 +0200 Subject: [PATCH 44/45] Remove push test --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 2e5d6b1c3..7c15f6437 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,7 +1,7 @@ name: pages on: push: - branches: [ Maison-de-la-Simulation/ddc/main, 106-docker-artifact ] + branches: [ Maison-de-la-Simulation/ddc/main ] pull_request: jobs: id_repo: From dc9833b15eb95ef411880a085cc1a4a810c75e94 Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Fri, 28 Apr 2023 10:26:17 +0200 Subject: [PATCH 45/45] Revert trigger --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7c15f6437..20f6c3f12 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,7 +1,7 @@ name: pages on: push: - branches: [ Maison-de-la-Simulation/ddc/main ] + branches: [ main ] pull_request: jobs: id_repo: