From ffbd0628e4136a682a8d3aabce08ab77ea59c497 Mon Sep 17 00:00:00 2001 From: thefringeninja <495495+thefringeninja@users.noreply.github.com> Date: Thu, 2 May 2024 08:38:36 -0700 Subject: [PATCH 1/4] fix busted editorconfig --- .editorconfig | 5 +- .github/workflows/base.yml | 60 ++--- .github/workflows/ci.yml | 4 +- .github/workflows/ee.yml | 80 +++--- .github/workflows/lts.yml | 4 +- .github/workflows/previous-lts.yml | 4 +- .github/workflows/publish.yml | 294 +++++++++++------------ .github/workflows/pull-request-check.yml | 28 +-- 8 files changed, 238 insertions(+), 241 deletions(-) diff --git a/.editorconfig b/.editorconfig index 1a4fb776a..f8951dafe 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,3 @@ -# EditorConfig is awesome: -http://EditorConfig.org - # top-most EditorConfig file root = true @@ -142,5 +139,5 @@ indent_size = 2 [*.{cmd,ps1}] indent_size = 8 -[*.{yaml, yml}] +[*.{yaml,yml}] indent_size = 2 diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 1c06abeb8..2d2cdf7cd 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -20,33 +20,33 @@ jobs: runs-on: ${{ matrix.os }} name: EventStore.Client.${{ matrix.test }}/${{ matrix.os }}/${{ matrix.framework }}/${{ inputs.docker-tag }} steps: - - name: Checkout - uses: actions/checkout@v3 - - shell: bash - run: | - git fetch --prune --unshallow - - name: Pull EventStore Image - shell: bash - run: | - docker pull docker.eventstore.com/eventstore-ce/eventstoredb-ce:${{ inputs.docker-tag }} - - 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.test }} - - name: Run Tests - shell: bash - env: - ES_DOCKER_TAG: ${{ inputs.docker-tag }} - 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 + - name: Checkout + uses: actions/checkout@v3 + - shell: bash + run: | + git fetch --prune --unshallow + - name: Pull EventStore Image + shell: bash + run: | + docker pull docker.eventstore.com/eventstore-ce/eventstoredb-ce:${{ inputs.docker-tag }} + - 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.test }} + - name: Run Tests + shell: bash + env: + ES_DOCKER_TAG: ${{ inputs.docker-tag }} + 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31add45a8..16e37e13d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,9 +4,9 @@ on: pull_request: push: branches: - - master + - master tags: - - v* + - v* jobs: test: diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml index a5b2951b6..16131af95 100644 --- a/.github/workflows/ee.yml +++ b/.github/workflows/ee.yml @@ -4,9 +4,9 @@ on: pull_request: push: branches: - - master + - master tags: - - v* + - v* jobs: test: @@ -22,41 +22,41 @@ jobs: 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 + - 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 diff --git a/.github/workflows/lts.yml b/.github/workflows/lts.yml index fd4e45bb1..e8aed42cd 100644 --- a/.github/workflows/lts.yml +++ b/.github/workflows/lts.yml @@ -4,9 +4,9 @@ on: pull_request: push: branches: - - master + - master tags: - - v* + - v* jobs: test: diff --git a/.github/workflows/previous-lts.yml b/.github/workflows/previous-lts.yml index c7d16ac1c..b4a45fa94 100644 --- a/.github/workflows/previous-lts.yml +++ b/.github/workflows/previous-lts.yml @@ -4,9 +4,9 @@ on: pull_request: push: branches: - - master + - master tags: - - v* + - v* jobs: test: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 146e3c967..d62a227f1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,9 +4,9 @@ on: pull_request: push: branches: - - master + - master tags: - - v* + - v* jobs: vulnerability-scan: @@ -19,22 +19,22 @@ jobs: runs-on: ${{ matrix.os }} name: scan-vulnerabilities/${{ matrix.os }}/${{ matrix.framework }} steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install dotnet SDKs - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 6.0.x - 7.0.x - 8.0.x - - name: Scan for Vulnerabilities - shell: bash - run: | - dotnet nuget list source - dotnet restore - dotnet list package --vulnerable --include-transitive --framework ${{ matrix.framework }} | tee vulnerabilities.txt - ! cat vulnerabilities.txt | grep -q "has the following vulnerable packages" + - name: Checkout + uses: actions/checkout@v3 + - name: Install dotnet SDKs + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + - name: Scan for Vulnerabilities + shell: bash + run: | + dotnet nuget list source + dotnet restore + dotnet list package --vulnerable --include-transitive --framework ${{ matrix.framework }} | tee vulnerabilities.txt + ! cat vulnerabilities.txt | grep -q "has the following vulnerable packages" build-samples: timeout-minutes: 5 @@ -53,46 +53,46 @@ jobs: EVENTSTORE_RUN_PROJECTIONS: all EVENTSTORE_START_STANDARD_PROJECTIONS: true ports: - - 2113:2113 + - 2113:2113 options: --health-cmd "exit 0" steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install dotnet SDKs - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 8.0.x - - name: Compile - shell: bash - run: | - dotnet build samples - - name: Run - shell: bash - run: | - find samples/ -type f -iname "*.csproj" -print0 | xargs -0L1 dotnet run --framework ${{ matrix.framework }} --project + - name: Checkout + uses: actions/checkout@v3 + - name: Install dotnet SDKs + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 8.0.x + - name: Compile + shell: bash + run: | + dotnet build samples + - name: Run + shell: bash + run: | + find samples/ -type f -iname "*.csproj" -print0 | xargs -0L1 dotnet run --framework ${{ matrix.framework }} --project generate-certificates: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Generate certificates - run: | - mkdir -p certs - docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-ca -out /tmp/ca - docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-node -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/node -ip-addresses 127.0.0.1 -dns-names localhost - docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-user -username admin -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/user-admin - docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-user -username invalid -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/user-invalid - - name: Set permissions on certificates - run: | - sudo chown -R $USER:$USER certs - sudo chmod -R 755 certs - - name: Upload certificates - uses: actions/upload-artifact@v2 - with: - name: certs - path: certs + - name: Checkout code + uses: actions/checkout@v2 + - name: Generate certificates + run: | + mkdir -p certs + docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-ca -out /tmp/ca + docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-node -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/node -ip-addresses 127.0.0.1 -dns-names localhost + docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-user -username admin -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/user-admin + docker run --rm --user root --volume "$PWD/certs:/tmp" docker.eventstore.com/eventstore-utils/es-gencert-cli:latest create-user -username invalid -ca-certificate /tmp/ca/ca.crt -ca-key /tmp/ca/ca.key -out /tmp/user-invalid + - name: Set permissions on certificates + run: | + sudo chown -R $USER:$USER certs + sudo chmod -R 755 certs + - name: Upload certificates + uses: actions/upload-artifact@v2 + with: + name: certs + path: certs test: needs: generate-certificates @@ -106,54 +106,54 @@ jobs: runs-on: ${{ matrix.os }} name: test/EventStore.Client/${{ matrix.os }}/${{ matrix.framework }} steps: - - name: Checkout - uses: actions/checkout@v3 - - shell: bash - run: | - git fetch --prune --unshallow - - 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 - - name: Download certificates - uses: actions/download-artifact@v2 - with: - name: certs - path: certs - - name: Import certificates (Linux) - if: runner.os == 'Linux' - shell: bash - run: | - sudo cp certs/ca/ca.crt /usr/local/share/ca-certificates/eventstore_ca.crt - sudo update-ca-certificates - - name: Import certificates (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - Import-Certificate -FilePath "certs\ca\ca.crt" -CertStoreLocation "Cert:\LocalMachine\Root" - - name: Run Tests (Linux) - if: runner.os == 'Linux' - shell: bash - run: | - dotnet test --configuration ${{ matrix.configuration }} --blame \ - --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \ - --framework ${{ matrix.framework }} \ - test/EventStore.Client.Tests - - name: Run Tests (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - dotnet test --configuration ${{ matrix.configuration }} --blame ` - --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" ` - --framework ${{ matrix.framework }} ` - test/EventStore.Client.Tests + - name: Checkout + uses: actions/checkout@v3 + - shell: bash + run: | + git fetch --prune --unshallow + - 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 + - name: Download certificates + uses: actions/download-artifact@v2 + with: + name: certs + path: certs + - name: Import certificates (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + sudo cp certs/ca/ca.crt /usr/local/share/ca-certificates/eventstore_ca.crt + sudo update-ca-certificates + - name: Import certificates (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + Import-Certificate -FilePath "certs\ca\ca.crt" -CertStoreLocation "Cert:\LocalMachine\Root" + - name: Run Tests (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + dotnet test --configuration ${{ matrix.configuration }} --blame \ + --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \ + --framework ${{ matrix.framework }} \ + test/EventStore.Client.Tests + - name: Run Tests (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + dotnet test --configuration ${{ matrix.configuration }} --blame ` + --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" ` + --framework ${{ matrix.framework }} ` + test/EventStore.Client.Tests publish: timeout-minutes: 5 @@ -161,50 +161,50 @@ jobs: runs-on: ubuntu-latest name: publish steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Get Version - id: get_version - run: | - echo "branch=${GITHUB_REF:10}" >> $GITHUB_OUTPUT - dotnet nuget list source - dotnet tool restore - version=$(dotnet tool run minver -- --tag-prefix=v) - echo "version=${version}" >> $GITHUB_OUTPUT - - shell: bash - run: | - git fetch --prune --unshallow - - name: Install dotnet SDKs - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 6.0.x - 7.0.x - 8.0.x - - name: Dotnet Pack - shell: bash - run: | - mkdir -p packages - dotnet pack /p:Version=${{ steps.get_version.outputs.version }} --configuration=Release \ - /p:PublishDir=./packages \ - /p:NoWarn=NU5105 \ - /p:RepositoryUrl=https://github.com/EventStore/EventStore-Client-Dotnet \ - /p:RepositoryType=git - - name: Publish Artifacts - uses: actions/upload-artifact@v1 - with: - path: packages - name: nuget-packages - - name: Dotnet Push to Github Packages - shell: bash - if: github.event_name == 'push' - run: | - dotnet tool restore - find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.github_token }} --source https://nuget.pkg.github.com/EventStore/index.json --skip-duplicate - - name: Dotnet Push to Nuget.org - shell: bash - if: contains(steps.get_version.outputs.branch, 'v') - run: | - dotnet nuget list source - dotnet tool restore - find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.nuget_key }} --source https://api.nuget.org/v3/index.json --skip-duplicate + - name: Checkout + uses: actions/checkout@v3 + - name: Get Version + id: get_version + run: | + echo "branch=${GITHUB_REF:10}" >> $GITHUB_OUTPUT + dotnet nuget list source + dotnet tool restore + version=$(dotnet tool run minver -- --tag-prefix=v) + echo "version=${version}" >> $GITHUB_OUTPUT + - shell: bash + run: | + git fetch --prune --unshallow + - name: Install dotnet SDKs + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + - name: Dotnet Pack + shell: bash + run: | + mkdir -p packages + dotnet pack /p:Version=${{ steps.get_version.outputs.version }} --configuration=Release \ + /p:PublishDir=./packages \ + /p:NoWarn=NU5105 \ + /p:RepositoryUrl=https://github.com/EventStore/EventStore-Client-Dotnet \ + /p:RepositoryType=git + - name: Publish Artifacts + uses: actions/upload-artifact@v1 + with: + path: packages + name: nuget-packages + - name: Dotnet Push to Github Packages + shell: bash + if: github.event_name == 'push' + run: | + dotnet tool restore + find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.github_token }} --source https://nuget.pkg.github.com/EventStore/index.json --skip-duplicate + - name: Dotnet Push to Nuget.org + shell: bash + if: contains(steps.get_version.outputs.branch, 'v') + run: | + dotnet nuget list source + dotnet tool restore + find . -name "*.nupkg" | xargs -n1 dotnet nuget push --api-key=${{ secrets.nuget_key }} --source https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/pull-request-check.yml b/.github/workflows/pull-request-check.yml index e25a8c544..17d1a4561 100644 --- a/.github/workflows/pull-request-check.yml +++ b/.github/workflows/pull-request-check.yml @@ -2,22 +2,22 @@ name: Pull Request check on: pull_request: paths-ignore: - - "test/**" - - "generators/**" - - "samples/**" - - "**.md" - - "gencert.sh" - - ".github/**" - - ".gitignore" - - ".gitattributes" - - ".editorconfig" - types: [opened, edited] + - "test/**" + - "generators/**" + - "samples/**" + - "**.md" + - "gencert.sh" + - ".github/**" + - ".gitignore" + - ".gitattributes" + - ".editorconfig" + types: [ opened, edited ] jobs: checkPullRequest: name: Pull Request check runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Check pull requests - uses: EventStore/Automations/pr-check@master + - name: Checkout + uses: actions/checkout@v3 + - name: Check pull requests + uses: EventStore/Automations/pr-check@master From 55aad8eba41514d2b47bd08bbf1b55902997012a Mon Sep 17 00:00:00 2001 From: thefringeninja <495495+thefringeninja@users.noreply.github.com> Date: Thu, 2 May 2024 08:39:34 -0700 Subject: [PATCH 2/4] checkout v4 --- .github/workflows/base.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 2d2cdf7cd..372ae0413 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -21,10 +21,9 @@ jobs: name: EventStore.Client.${{ matrix.test }}/${{ matrix.os }}/${{ matrix.framework }}/${{ inputs.docker-tag }} steps: - name: Checkout - uses: actions/checkout@v3 - - shell: bash - run: | - git fetch --prune --unshallow + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Pull EventStore Image shell: bash run: | From da61e84d6b2c1a49a9586fa57120227423cff38c 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 3/4] 'refactor' workflows add variable for the docker registry changed ee tests to use base as the base https://docs.github.com/en/actions/using-workflows/reusing-workflows#passing-inputs-and-secrets-to-a-reusable-workflow https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-secrets --- .github/workflows/base.yml | 52 ++++++++++---- .github/workflows/ce.yml | 33 +++++++++ .../{dispatch.yml => dispatch-ce.yml} | 9 ++- .github/workflows/dispatch-ee.yml | 20 ++++++ .github/workflows/ee.yml | 67 +++++++------------ .github/workflows/lts.yml | 2 +- 6 files changed, 122 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/ce.yml rename .github/workflows/{dispatch.yml => dispatch-ce.yml} (51%) create mode 100644 .github/workflows/dispatch-ee.yml 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 From e3aa47e2f7f619e3958dfbee73cd0e20aeb9e73e Mon Sep 17 00:00:00 2001 From: Joseph Cummings Date: Tue, 4 Jun 2024 18:07:06 +0100 Subject: [PATCH 4/4] Fixup workflows --- .github/workflows/base.yml | 27 ++++++++------------ .github/workflows/ce.yml | 33 ------------------------ .github/workflows/ci.yml | 30 +++++++++++++++++++--- .github/workflows/dispatch-ce.yml | 20 ++++++++++----- .github/workflows/dispatch-ee.yml | 23 ++++++++++++----- .github/workflows/ee.yml | 41 ------------------------------ .github/workflows/lts.yml | 15 ----------- .github/workflows/previous-lts.yml | 15 ----------- 8 files changed, 66 insertions(+), 138 deletions(-) delete mode 100644 .github/workflows/ce.yml delete mode 100644 .github/workflows/ee.yml delete mode 100644 .github/workflows/lts.yml delete mode 100644 .github/workflows/previous-lts.yml diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 85a817aa6..752de25fb 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -15,24 +15,21 @@ on: 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 - runs-on: ${{ inputs.os }} - name: EventStore.Client.${{ inputs.test }}/${{ inputs.os }}/${{ inputs.framework }}/${{ inputs.docker-tag }} + strategy: + fail-fast: false + matrix: + framework: [ net6.0, net7.0, net8.0 ] + os: [ ubuntu-latest ] + configuration: [ release ] + runs-on: ${{ matrix.os }} + name: ${{ inputs.test }} (${{ matrix.os }}, ${{ matrix.framework }}) env: CLOUDSMITH_CICD_USER: ${{ secrets.CLOUDSMITH_CICD_USER }} steps: @@ -58,10 +55,6 @@ jobs: 6.0.x 7.0.x 8.0.x - - name: Compile - shell: bash - run: | - dotnet build --configuration ${{ inputs.configuration }} --framework ${{ inputs.framework }} src/EventStore.Client.${{ inputs.test }} - name: Run Tests shell: bash env: @@ -69,7 +62,7 @@ jobs: ES_DOCKER_REGISTRY: docker.eventstore.com/${{ inputs.docker-image }} run: | sudo ./gencert.sh - dotnet test --configuration ${{ inputs.configuration }} --blame \ + dotnet test --configuration ${{ matrix.configuration }} --blame \ --logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \ - --framework ${{ inputs.framework }} \ + --framework ${{ matrix.framework }} \ test/EventStore.Client.${{ inputs.test }}.Tests diff --git a/.github/workflows/ce.yml b/.github/workflows/ce.yml deleted file mode 100644 index 8a0bb2e64..000000000 --- a/.github/workflows/ce.yml +++ /dev/null @@ -1,33 +0,0 @@ -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/ci.yml b/.github/workflows/ci.yml index 16e37e13d..4b8e1f9b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test CI +name: CI on: pull_request: @@ -9,7 +9,31 @@ on: - v* jobs: - test: + ce: uses: ./.github/workflows/base.yml + strategy: + fail-fast: false + matrix: + docker-tag: [ ci, lts, previous-lts ] + test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement ] + name: Test CE (${{ matrix.docker-tag }}) with: - docker-tag: ci + docker-tag: ${{ matrix.docker-tag }} + docker-image: eventstore-ce/eventstoredb-ce + test: ${{ matrix.test }} + ee: + uses: ./.github/workflows/base.yml + if: ${{ github.repository_owner == 'EventStore' }} + strategy: + fail-fast: false + matrix: + docker-tag: [ 24.2.0-jammy ] + test: [ Plugins ] + name: Test EE (${{ matrix.docker-tag }}) + with: + docker-tag: ${{ matrix.docker-tag }} + docker-image: eventstore-ee/eventstoredb-commercial + test: ${{ matrix.test }} + secrets: + CLOUDSMITH_CICD_USER: ${{ secrets.CLOUDSMITH_CICD_USER }} + CLOUDSMITH_CICD_TOKEN: ${{ secrets.CLOUDSMITH_CICD_TOKEN }} diff --git a/.github/workflows/dispatch-ce.yml b/.github/workflows/dispatch-ce.yml index fc21b66d6..722baaea7 100644 --- a/.github/workflows/dispatch-ce.yml +++ b/.github/workflows/dispatch-ce.yml @@ -1,20 +1,26 @@ -name: "Dispatch CE" +name: Dispatch CE on: workflow_dispatch: inputs: - version: - description: "Docker tag version" + docker-tag: + description: "Docker tag" required: true type: string - image: + docker-image: description: "Docker image" required: true type: string jobs: test: - uses: ./.github/workflows/ce.yml + uses: ./.github/workflows/base.yml + strategy: + fail-fast: false + matrix: + test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement ] + name: Test CE (${{ inputs.docker-tag }}) with: - docker-tag: ${{ inputs.version }} - docker-image: ${{ inputs.image }} + docker-tag: ${{ inputs.docker-tag }} + docker-image: ${{ inputs.docker-image }} + test: ${{ matrix.test }} diff --git a/.github/workflows/dispatch-ee.yml b/.github/workflows/dispatch-ee.yml index ceaf6921e..13f0b3398 100644 --- a/.github/workflows/dispatch-ee.yml +++ b/.github/workflows/dispatch-ee.yml @@ -1,20 +1,29 @@ -name: "Dispatch EE" +name: Dispatch EE on: workflow_dispatch: inputs: - version: - description: "Docker tag version" + docker-tag: + description: "Docker tag" required: true type: string - image: + docker-image: description: "Docker image" required: true type: string jobs: test: - uses: ./.github/workflows/ee.yml + uses: ./.github/workflows/base.yml + strategy: + fail-fast: false + matrix: + test: [ Plugins ] + name: Test EE (${{ inputs.docker-tag }}) with: - docker-tag: ${{ inputs.version }} - docker-image: ${{ inputs.image }} + docker-tag: ${{ inputs.docker-tag }} + docker-image: ${{ inputs.docker-image }} + test: ${{ matrix.test }} + secrets: + CLOUDSMITH_CICD_USER: ${{ secrets.CLOUDSMITH_CICD_USER }} + CLOUDSMITH_CICD_TOKEN: ${{ secrets.CLOUDSMITH_CICD_TOKEN }} diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml deleted file mode 100644 index e59984a50..000000000 --- a/.github/workflows/ee.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Test EE - -on: - pull_request: - push: - branches: - - 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: - 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 ] - test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement, Plugins ] - configuration: [ release ] - 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 deleted file mode 100644 index 4a2523a85..000000000 --- a/.github/workflows/lts.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Test LTS - -on: - pull_request: - push: - branches: - - master - tags: - - v* - -jobs: - test: - uses: ./.github/workflows/ce.yml - with: - docker-tag: lts diff --git a/.github/workflows/previous-lts.yml b/.github/workflows/previous-lts.yml deleted file mode 100644 index b4a45fa94..000000000 --- a/.github/workflows/previous-lts.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Test Previous LTS - -on: - pull_request: - push: - branches: - - master - tags: - - v* - -jobs: - test: - uses: ./.github/workflows/base.yml - with: - docker-tag: previous-lts