diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 372ae0413..85a817aa6 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -2,32 +2,55 @@ name: Build on: workflow_call: + secrets: + CLOUDSMITH_CICD_USER: + required: false + CLOUDSMITH_CICD_TOKEN: + required: false inputs: docker-tag: required: true type: string + docker-image: + required: false + type: string + default: eventstore-ce/eventstoredb-ce + framework: + required: true + type: string + os: + required: true + type: string + test: + required: true + type: string + configuration: + required: true + type: string jobs: test: timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - framework: [ net6.0, net7.0, net8.0 ] - os: [ ubuntu-latest ] - test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement ] - configuration: [ release ] - runs-on: ${{ matrix.os }} - name: EventStore.Client.${{ matrix.test }}/${{ matrix.os }}/${{ matrix.framework }}/${{ inputs.docker-tag }} + runs-on: ${{ inputs.os }} + name: EventStore.Client.${{ inputs.test }}/${{ inputs.os }}/${{ inputs.framework }}/${{ inputs.docker-tag }} + env: + CLOUDSMITH_CICD_USER: ${{ secrets.CLOUDSMITH_CICD_USER }} steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Login to Cloudsmith + if: ${{ env.CLOUDSMITH_CICD_USER != '' }} + 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 docker.eventstore.com/${{ inputs.docker-image }}:${{ inputs.docker-tag }} - name: Install dotnet SDKs uses: actions/setup-dotnet@v3 with: @@ -38,14 +61,15 @@ jobs: - name: Compile shell: bash run: | - dotnet build --configuration ${{ matrix.configuration }} --framework ${{ matrix.framework }} src/EventStore.Client.${{ matrix.test }} + dotnet build --configuration ${{ inputs.configuration }} --framework ${{ inputs.framework }} src/EventStore.Client.${{ inputs.test }} - name: Run Tests shell: bash env: ES_DOCKER_TAG: ${{ inputs.docker-tag }} + ES_DOCKER_REGISTRY: docker.eventstore.com/${{ inputs.docker-image }} run: | sudo ./gencert.sh - dotnet test --configuration ${{ matrix.configuration }} --blame \ + dotnet test --configuration ${{ inputs.configuration }} --blame \ --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \ - --framework ${{ matrix.framework }} \ - test/EventStore.Client.${{ matrix.test }}.Tests + --framework ${{ inputs.framework }} \ + test/EventStore.Client.${{ inputs.test }}.Tests diff --git a/.github/workflows/ce.yml b/.github/workflows/ce.yml new file mode 100644 index 000000000..8a0bb2e64 --- /dev/null +++ b/.github/workflows/ce.yml @@ -0,0 +1,33 @@ +name: Test CE + +on: + workflow_call: + inputs: + docker-tag: + required: true + type: string + docker-image: + required: false + type: string + default: eventstore-ce/eventstoredb-ce + +jobs: + test: + uses: ./.github/workflows/base.yml + strategy: + fail-fast: false + matrix: + framework: [ net6.0, net7.0, net8.0 ] + os: [ ubuntu-latest ] + test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement ] + configuration: [ release ] + with: + docker-tag: ${{ inputs.docker-tag }} + docker-image: ${{ inputs.docker-image }} + framework: ${{ matrix.framework }} + os: ${{ matrix.os }} + test: ${{ matrix.test }} + configuration: ${{ matrix.configuration }} + secrets: + CLOUDSMITH_CICD_USER: ${{ secrets.CLOUDSMITH_CICD_USER }} + CLOUDSMITH_CICD_TOKEN: ${{ secrets.CLOUDSMITH_CICD_TOKEN }} diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch-ce.yml similarity index 51% rename from .github/workflows/dispatch.yml rename to .github/workflows/dispatch-ce.yml index 927050291..fc21b66d6 100644 --- a/.github/workflows/dispatch.yml +++ b/.github/workflows/dispatch-ce.yml @@ -1,4 +1,4 @@ -name: "Dispatch" +name: "Dispatch CE" on: workflow_dispatch: @@ -7,9 +7,14 @@ on: description: "Docker tag version" required: true type: string + image: + description: "Docker image" + required: true + type: string jobs: test: - uses: ./.github/workflows/base.yml + uses: ./.github/workflows/ce.yml with: docker-tag: ${{ inputs.version }} + docker-image: ${{ inputs.image }} diff --git a/.github/workflows/dispatch-ee.yml b/.github/workflows/dispatch-ee.yml new file mode 100644 index 000000000..ceaf6921e --- /dev/null +++ b/.github/workflows/dispatch-ee.yml @@ -0,0 +1,20 @@ +name: "Dispatch EE" + +on: + workflow_dispatch: + inputs: + version: + description: "Docker tag version" + required: true + type: string + image: + description: "Docker image" + required: true + type: string + +jobs: + test: + uses: ./.github/workflows/ee.yml + with: + docker-tag: ${{ inputs.version }} + docker-image: ${{ inputs.image }} diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml index 16131af95..e59984a50 100644 --- a/.github/workflows/ee.yml +++ b/.github/workflows/ee.yml @@ -7,56 +7,35 @@ on: - master tags: - v* + workflow_call: + inputs: + docker-tag: + required: true + type: string + docker-image: + required: false + type: string + default: eventstore-ce/eventstoredb-ce 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 ] + test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement, 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 + with: + docker-image: ${{ inputs.docker-image != null && inputs.docker-image || 'eventstore-ee/eventstoredb-commercial' }} + docker-tag: ${{ inputs.docker-tag != null && inputs.docker-tag || '24.2.0-jammy' }} + framework: ${{ matrix.framework }} + os: ${{ matrix.os }} + test: ${{ matrix.test }} + configuration: ${{ matrix.configuration }} + secrets: + CLOUDSMITH_CICD_USER: ${{ secrets.CLOUDSMITH_CICD_USER }} + CLOUDSMITH_CICD_TOKEN: ${{ secrets.CLOUDSMITH_CICD_TOKEN }} + diff --git a/.github/workflows/lts.yml b/.github/workflows/lts.yml index e8aed42cd..4a2523a85 100644 --- a/.github/workflows/lts.yml +++ b/.github/workflows/lts.yml @@ -10,6 +10,6 @@ on: jobs: test: - uses: ./.github/workflows/base.yml + uses: ./.github/workflows/ce.yml with: docker-tag: lts