From 11dc341e7aa2aa00059355ff327ce0d30c36b3b8 Mon Sep 17 00:00:00 2001 From: nadav mizrahi Date: Tue, 3 Jun 2025 14:50:28 +0300 Subject: [PATCH] CI | seperate noobaa image build to different action Signed-off-by: nadav mizrahi --- .github/workflows/ceph-nsfs-s3-tests.yaml | 19 ++++-- .github/workflows/ceph-s3-tests.yaml | 19 ++++-- .github/workflows/nc_unit.yml | 19 ++++-- .github/workflows/postgres-unit-tests.yaml | 19 ++++-- .github/workflows/run-pr-tests.yaml | 71 ++++++++++++++++++++++ .github/workflows/sanity-ssl.yaml | 19 ++++-- .github/workflows/sanity.yaml | 19 ++++-- .github/workflows/unit.yaml | 22 +++++-- .github/workflows/warp-nc-tests.yaml | 19 ++++-- .github/workflows/warp-tests.yaml | 19 ++++-- 10 files changed, 199 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/run-pr-tests.yaml diff --git a/.github/workflows/ceph-nsfs-s3-tests.yaml b/.github/workflows/ceph-nsfs-s3-tests.yaml index 90a1a79de8..8ea3acf314 100644 --- a/.github/workflows/ceph-nsfs-s3-tests.yaml +++ b/.github/workflows/ceph-nsfs-s3-tests.yaml @@ -1,13 +1,13 @@ name: NSFS Ceph S3 Tests -on: [push, pull_request, workflow_dispatch] +on: [workflow_call] jobs: nsfs-ceph-s3-tests: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: Checkout noobaa-core uses: actions/checkout@v4 @@ -15,10 +15,19 @@ jobs: repository: 'noobaa/noobaa-core' path: 'noobaa-core' + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Run NSFS Ceph s3-tests run: | set -x cd ./noobaa-core mkdir -p logs/ceph-nsfs-test-logs chmod 777 logs/ceph-nsfs-test-logs - make test-nsfs-cephs3 + make test-nsfs-cephs3 -o tester diff --git a/.github/workflows/ceph-s3-tests.yaml b/.github/workflows/ceph-s3-tests.yaml index acba9eb7cb..6da320f9c8 100644 --- a/.github/workflows/ceph-s3-tests.yaml +++ b/.github/workflows/ceph-s3-tests.yaml @@ -1,13 +1,13 @@ name: Ceph S3 Tests -on: [push, pull_request, workflow_dispatch] +on: [workflow_call] jobs: ceph-s3-tests: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: Checkout noobaa-core uses: actions/checkout@v4 @@ -15,10 +15,19 @@ jobs: repository: 'noobaa/noobaa-core' path: 'noobaa-core' + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Run Ceph s3-tests run: | set -x cd ./noobaa-core mkdir -p logs/ceph-test-logs chmod 777 logs/ceph-test-logs - make test-cephs3 + make test-cephs3 -o tester diff --git a/.github/workflows/nc_unit.yml b/.github/workflows/nc_unit.yml index dfe66d858e..0ca3295131 100644 --- a/.github/workflows/nc_unit.yml +++ b/.github/workflows/nc_unit.yml @@ -1,17 +1,26 @@ name: Non Containerized Unit Tests -on: [push, pull_request] +on: [workflow_call] jobs: run-nc-unit-tests: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: checkout uses: actions/checkout@v4 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Run Non Containerized Test run: | - make run-nc-tests + make run-nc-tests -o tester diff --git a/.github/workflows/postgres-unit-tests.yaml b/.github/workflows/postgres-unit-tests.yaml index e7e16ea408..8eb4d52772 100644 --- a/.github/workflows/postgres-unit-tests.yaml +++ b/.github/workflows/postgres-unit-tests.yaml @@ -1,16 +1,25 @@ name: Unit Tests with Postgres -on: [push, pull_request] +on: [workflow_call] jobs: run-unit-tests-postgres: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: Checkout uses: actions/checkout@v4 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Run Unit Tests with Postgres - run: make test-postgres + run: make test-postgres -o tester diff --git a/.github/workflows/run-pr-tests.yaml b/.github/workflows/run-pr-tests.yaml new file mode 100644 index 0000000000..bd6888c582 --- /dev/null +++ b/.github/workflows/run-pr-tests.yaml @@ -0,0 +1,71 @@ +name: Run PR Tests +on: [push, pull_request, workflow_dispatch] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + + run-sanity-tests: + needs: build-noobaa-image + uses: ./.github/workflows/sanity.yaml + + run-sanity-ssl-tests: + needs: build-noobaa-image + uses: ./.github/workflows/sanity-ssl.yaml + + run-unit-tests: + needs: build-noobaa-image + uses: ./.github/workflows/unit.yaml + + run-unit-tests-postgres: + needs: build-noobaa-image + uses: ./.github/workflows/postgres-unit-tests.yaml + + run-nc-unit-tests: + needs: build-noobaa-image + uses: ./.github/workflows/nc_unit.yml + + ceph-s3-tests: + needs: build-noobaa-image + uses: ./.github/workflows/ceph-s3-tests.yaml + + ceph-nsfs-s3-tests: + needs: build-noobaa-image + uses: ./.github/workflows/ceph-nsfs-s3-tests.yaml + + warp-tests: + needs: build-noobaa-image + uses: ./.github/workflows/warp-tests.yaml + + warp-nc-tests: + needs: build-noobaa-image + uses: ./.github/workflows/warp-nc-tests.yaml + + build-noobaa-image: + runs-on: ubuntu-latest + timeout-minutes: 90 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: make noobaa image + run: make tester + + - name: create docker artifact + run: | + docker save --output noobaa.tar noobaa + docker save --output noobaa-tester.tar noobaa-tester + + - name: upload noobaa docker image + uses: actions/upload-artifact@v4 + with: + name: noobaa-image + path: noobaa.tar + retention-days: "1" + + - name: upload noobaa-tester docker image + uses: actions/upload-artifact@v4 + with: + name: noobaa-tester + path: noobaa-tester.tar + retention-days: "1" diff --git a/.github/workflows/sanity-ssl.yaml b/.github/workflows/sanity-ssl.yaml index 427c7a88f9..ea543823bb 100644 --- a/.github/workflows/sanity-ssl.yaml +++ b/.github/workflows/sanity-ssl.yaml @@ -1,20 +1,29 @@ name: Build & Sanity SSL -on: [push, pull_request] +on: [workflow_call] jobs: run-sanity-ssl-tests: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: Checkout uses: actions/checkout@v4 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Run Build & SSL Sanity Tests run: | set -x mkdir -p logs/sanity-test-logs chmod 777 logs/sanity-test-logs - make test-external-pg-sanity + make test-external-pg-sanity -o tester diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml index 11b44319b2..1504491401 100644 --- a/.github/workflows/sanity.yaml +++ b/.github/workflows/sanity.yaml @@ -1,20 +1,29 @@ name: Build & Sanity -on: [push, pull_request] +on: [workflow_call] jobs: run-sanity-tests: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: Checkout uses: actions/checkout@v4 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Run Build & Sanity Tests run: | set -x mkdir -p logs/sanity-test-logs chmod 777 logs/sanity-test-logs - make test-sanity + make test-sanity -o tester diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index d78b9e64a2..52d7857a96 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -1,18 +1,28 @@ name: Unit Tests -on: [push, pull_request] +on: [workflow_call] jobs: run-unit-tests: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: checkout uses: actions/checkout@v4 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Run Test run: | - make test - make root-perm-test + make test -o tester + make root-perm-test -o tester + diff --git a/.github/workflows/warp-nc-tests.yaml b/.github/workflows/warp-nc-tests.yaml index fad18558da..f506ea401d 100644 --- a/.github/workflows/warp-nc-tests.yaml +++ b/.github/workflows/warp-nc-tests.yaml @@ -1,14 +1,14 @@ name: Warp NC Tests -on: [push, pull_request, workflow_dispatch] +on: [workflow_call] jobs: warp-nc-tests: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: Checkout noobaa-core uses: actions/checkout@v4 @@ -16,6 +16,15 @@ jobs: repository: 'noobaa/noobaa-core' path: 'noobaa-core' + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Create Warp logs directory run: | set -x @@ -27,5 +36,5 @@ jobs: run: | set -x cd ./noobaa-core - make test-nc-warp + make test-nc-warp -o tester diff --git a/.github/workflows/warp-tests.yaml b/.github/workflows/warp-tests.yaml index 3001e1e85b..a231ca6bfa 100644 --- a/.github/workflows/warp-tests.yaml +++ b/.github/workflows/warp-tests.yaml @@ -1,13 +1,13 @@ name: Warp Tests -on: [push, pull_request, workflow_dispatch] +on: [workflow_call] jobs: warp-tests: runs-on: ubuntu-latest timeout-minutes: 90 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + permissions: + actions: read # download-artifact + contents: read # required for actions/checkout steps: - name: Checkout noobaa-core uses: actions/checkout@v4 @@ -15,6 +15,15 @@ jobs: repository: 'noobaa/noobaa-core' path: 'noobaa-core' + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: noobaa-tester + path: /tmp + + - name: Load image + run: docker load --input /tmp/noobaa-tester.tar + - name: Create Warp logs directory run: | set -x @@ -26,5 +35,5 @@ jobs: run: | set -x cd ./noobaa-core - make test-warp + make test-warp -o tester