From 6e27311ac953e80ae1ff4b56bd853fca277f1e72 Mon Sep 17 00:00:00 2001 From: thefringeninja <495495+thefringeninja@users.noreply.github.com> Date: Thu, 2 May 2024 09:28:17 -0700 Subject: [PATCH] 'refactor' workflows add variable for the docker registry changed ee tests to use base as the base --- .github/workflows/base.yml | 14 +++++++- .github/workflows/dispatch.yml | 5 +++ .github/workflows/ee.yml | 52 ++++-------------------------- .github/workflows/previous-lts.yml | 1 + 4 files changed, 25 insertions(+), 47 deletions(-) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 372ae0413..dc3b87250 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -6,6 +6,10 @@ on: docker-tag: required: true type: string + docker-registry: + required: true + type: string + default: docker.eventstore.com/eventstore-ce/eventstoredb-ce jobs: test: @@ -24,10 +28,17 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Login to Cloudsmith + if: ${{ github.repository_owner == "EventStore" }} + uses: docker/login-action@v3 + with: + registry: docker.eventstore.com + username: ${{ secrets.CLOUDSMITH_CICD_USER }} + password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }} - name: Pull EventStore Image shell: bash run: | - docker pull docker.eventstore.com/eventstore-ce/eventstoredb-ce:${{ inputs.docker-tag }} + docker pull ${{ inputs.docker-registry }}:${{ inputs.docker-tag }} - name: Install dotnet SDKs uses: actions/setup-dotnet@v3 with: @@ -43,6 +54,7 @@ jobs: shell: bash env: ES_DOCKER_TAG: ${{ inputs.docker-tag }} + ES_DOCKER_REGISTRY: ${{ inputs.docker-registry }} run: | sudo ./gencert.sh dotnet test --configuration ${{ matrix.configuration }} --blame \ diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml index 927050291..6bf964dd1 100644 --- a/.github/workflows/dispatch.yml +++ b/.github/workflows/dispatch.yml @@ -7,9 +7,14 @@ on: description: "Docker tag version" required: true type: string + repository: + description: "Docker registry" + required: true + type: string jobs: test: uses: ./.github/workflows/base.yml with: docker-tag: ${{ inputs.version }} + docker-registry: ${{ inputs.registry }} diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml index 16131af95..02edda85b 100644 --- a/.github/workflows/ee.yml +++ b/.github/workflows/ee.yml @@ -10,53 +10,13 @@ on: jobs: test: - timeout-minutes: 20 + uses: ./.github/workflows/base.yml + if: ${{ github.repository_owner == "EventStore" }} strategy: - fail-fast: false matrix: framework: [ net6.0, net7.0, net8.0 ] os: [ ubuntu-latest ] - build: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement ] - test: [ Plugins ] - configuration: [ release ] - runs-on: ${{ matrix.os }} - name: EventStore.Client.${{ matrix.test }}/${{ matrix.os }}/${{ matrix.framework }}/24.2.0-jammy - steps: - - name: Checkout - uses: actions/checkout@v3 - - shell: bash - run: | - git fetch --prune --unshallow - - name: Login to Cloudsmith - uses: docker/login-action@v3 - with: - registry: docker.eventstore.com - username: ${{ secrets.CLOUDSMITH_CICD_USER }} - password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }} - - name: Pull EventStore Image - shell: bash - run: | - docker pull docker.eventstore.com/eventstore-ee/eventstoredb-commercial:24.2.0-jammy - - name: Install dotnet SDKs - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 6.0.x - 7.0.x - 8.0.x - - name: Compile - shell: bash - run: | - dotnet build --configuration ${{ matrix.configuration }} --framework ${{ matrix.framework }} src/EventStore.Client.${{ matrix.build }} - - name: Run Tests - if: ${{ inputs.docker-registry == '' }} - shell: bash - env: - ES_DOCKER_TAG: 24.2.0-jammy - ES_DOCKER_REGISTRY: docker.eventstore.com/eventstore-ee/eventstoredb-commercial - run: | - sudo ./gencert.sh - dotnet test --configuration ${{ matrix.configuration }} --blame \ - --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \ - --framework ${{ matrix.framework }} \ - test/EventStore.Client.${{ matrix.test }}.Tests + build: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement ] + with: + docker-tag: lts + docker-registry: docker.eventstore.com/eventstore-ee/eventstoredb-commercial diff --git a/.github/workflows/previous-lts.yml b/.github/workflows/previous-lts.yml index b4a45fa94..83cdbec3a 100644 --- a/.github/workflows/previous-lts.yml +++ b/.github/workflows/previous-lts.yml @@ -13,3 +13,4 @@ jobs: uses: ./.github/workflows/base.yml with: docker-tag: previous-lts +