Skip to content

Commit

Permalink
Improve CI
Browse files Browse the repository at this point in the history
  • Loading branch information
w1am committed Jan 8, 2025
1 parent 7699152 commit 4c238c7
Show file tree
Hide file tree
Showing 86 changed files with 175 additions and 108 deletions.
74 changes: 39 additions & 35 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,54 @@ on:
required: false
type: string
default: eventstore-ce/eventstoredb-ce
test:
required: true
type: string

jobs:
test:
timeout-minutes: 20
strategy:
strategy:
fail-fast: false
matrix:
framework: [ net8.0, net9.0 ]
framework: [ net9.0 ]
os: [ ubuntu-latest ]
configuration: [ release ]
runs-on: ${{ matrix.os }}
name: (${{ matrix.os }}, ${{ matrix.framework }})
name: ${{ inputs.test }} (${{ matrix.os }}, ${{ matrix.framework }})
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/${{ inputs.docker-image }}:${{ inputs.docker-tag }}
- name: Install dotnet SDKs
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
9.0.x
- 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 \
--logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \
--framework ${{ matrix.framework }} \
test/Kurrent.Client.Tests
- 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/${{ inputs.docker-image }}:${{ inputs.docker-tag }}
- name: Install dotnet SDKs
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
9.0.x
- 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 \
--logger:"GitHubActions;report-warnings=false" --logger:"console;verbosity=normal" \
--framework ${{ matrix.framework }} \
--filter "Category=Target:${{ inputs.test }}" \
test/Kurrent.Client.Tests
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@ jobs:
fail-fast: false
matrix:
docker-tag: [ ci, lts, previous-lts ]
test: [ Streams, PersistentSubscriptions, Operations, Projections, Security, Misc ]
name: Test CE (${{ matrix.docker-tag }})
with:
docker-tag: ${{ matrix.docker-tag }}
docker-image: eventstore-ce/eventstoredb-ce
# 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 }}
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 }}
8 changes: 4 additions & 4 deletions .github/workflows/dispatch-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ on:
jobs:
test:
uses: ./.github/workflows/base.yml
# strategy:
# fail-fast: false
# matrix:
# test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement ]
strategy:
fail-fast: false
matrix:
test: [ Streams, PersistentSubscriptions, Operations, Projections, Security, Misc ]
name: Test CE (${{ inputs.docker-tag }})
with:
docker-tag: ${{ inputs.docker-tag }}
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/dispatch-ee.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#name: Dispatch EE
#
#on:
# workflow_dispatch:
# inputs:
# docker-tag:
# description: "Docker tag"
# required: true
# type: string
# docker-image:
# description: "Docker image"
# required: true
# type: string
#
#jobs:
# test:
# uses: ./.github/workflows/base.yml
## strategy:
## fail-fast: false
## matrix:
## test: [ Plugins ]
# name: Test EE (${{ inputs.docker-tag }})
# with:
# 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 }}
name: Dispatch EE

on:
workflow_dispatch:
inputs:
docker-tag:
description: "Docker tag"
required: true
type: string
docker-image:
description: "Docker image"
required: true
type: string

jobs:
test:
uses: ./.github/workflows/base.yml
strategy:
fail-fast: false
matrix:
test: [ Plugins ]
name: Test EE (${{ inputs.docker-tag }})
with:
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 }}
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/ClientCertificatesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Misc")]
[Trait("Category", "Target:Plugins")]
[Trait("Category", "Type:UserCertificate")]
public class ClientCertificateTests(ITestOutputHelper output, KurrentPermanentFixture fixture)
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/ConnectionStringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Misc")]
public class ConnectionStringTests {
public static IEnumerable<object?[]> ValidCases() {
var fixture = new Fixture();
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/FromAllTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Misc")]
public class FromAllTests : ValueObjectTests<FromAll> {
public FromAllTests() : base(new ScenarioFixture()) { }

Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/FromStreamTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Misc")]
public class FromStreamTests : ValueObjectTests<FromStream> {
public FromStreamTests() : base(new ScenarioFixture()) { }

Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/GossipChannelSelectorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Misc")]
public class GossipChannelSelectorTests {
[RetryFact]
public async Task ExplicitlySettingEndPointChangesChannels() {
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/KurrentClientOperationsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Misc")]
public class KurrentClientOperationOptionsTests {
[RetryFact]
public void setting_options_on_clone_should_not_modify_original() {
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/NodePreferenceComparerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Misc")]
public class NodePreferenceComparerTests {
static ClusterMessages.VNodeState RunTest(IComparer<ClusterMessages.VNodeState> sut, params ClusterMessages.VNodeState[] states) =>
states
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/NodeSelectorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Misc")]
public class NodeSelectorTests {
static readonly ClusterMessages.VNodeState[] NotAllowedStates = {
ClusterMessages.VNodeState.Manager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Operations")]
public class AuthenticationTests(ITestOutputHelper output, AuthenticationTests.CustomFixture fixture)
: KurrentPermanentTests<AuthenticationTests.CustomFixture>(output, fixture) {
public enum CredentialsCase { None, TestUser, RootUser }
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/Operations/MergeIndexTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Operations")]
public class MergeIndexTests(ITestOutputHelper output, MergeIndexTests.CustomFixture fixture)
: KurrentPermanentTests<MergeIndexTests.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/Operations/ResignNodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Kurrent.Client.Tests.Operations;

[Trait("Category", "Target:Operations")]
public class ResignNodeTests(ITestOutputHelper output, ResignNodeTests.CustomFixture fixture)
: KurrentTemporaryTests<ResignNodeTests.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests.Operations;

[Trait("Category", "Target:Operations")]
public class RestartPersistentSubscriptionsTests(ITestOutputHelper output, RestartPersistentSubscriptionsTests.CustomFixture fixture)
: KurrentTemporaryTests<RestartPersistentSubscriptionsTests.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/Operations/ScavengeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Operations")]
public class ScavengeTests(ITestOutputHelper output, ScavengeTests.CustomFixture fixture)
: KurrentTemporaryTests<ScavengeTests.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Kurrent.Client.Tests;

[Trait("Category", "Target:Operations")]
public class ShutdownNodeAuthenticationTests(ITestOutputHelper output, ShutdownNodeAuthenticationTests.CustomFixture fixture)
: KurrentTemporaryTests<ShutdownNodeAuthenticationTests.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
1 change: 1 addition & 0 deletions test/Kurrent.Client.Tests/Operations/ShutdownNodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests.Operations;

[Trait("Category", "Target:Operations")]
public class ShutdownNodeTests(ITestOutputHelper output, ShutdownNodeTests.NoDefaultCredentialsFixture fixture)
: KurrentTemporaryTests<ShutdownNodeTests.NoDefaultCredentialsFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllConnectWithoutReadPermissionsTests(ITestOutputHelper output, KurrentTemporaryFixture fixture)
: KurrentTemporaryTests<KurrentTemporaryFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllFilterTests(ITestOutputHelper output, KurrentTemporaryFixture fixture)
: KurrentTemporaryTests<KurrentTemporaryFixture>(output, fixture) {
[RetryTheory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllGetInfoTests(SubscribeToAllGetInfoTests.CustomFixture fixture)
: IClassFixture<SubscribeToAllGetInfoTests.CustomFixture> {
static readonly PersistentSubscriptionSettings Settings = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllListWithIncorrectCredentialsTests(ITestOutputHelper output, SubscribeToAllListWithIncorrectCredentialsTests.CustomFixture fixture)
: KurrentTemporaryTests<SubscribeToAllListWithIncorrectCredentialsTests.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllNoDefaultCredentialsTests(ITestOutputHelper output, SubscribeToAllNoDefaultCredentialsTests.CustomFixture fixture)
: KurrentPermanentTests<SubscribeToAllNoDefaultCredentialsTests.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllReplayParkedTests(ITestOutputHelper output, SubscribeToAllReplayParkedTests.CustomFixture fixture)
: KurrentPermanentTests<SubscribeToAllReplayParkedTests.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllResultWithNormalUserCredentialsTests(ITestOutputHelper output, KurrentTemporaryFixture fixture)
: KurrentTemporaryTests<KurrentTemporaryFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllReturnsAllSubscriptions(ITestOutputHelper output, SubscribeToAllReturnsAllSubscriptions.CustomFixture fixture)
: KurrentTemporaryTests<SubscribeToAllReturnsAllSubscriptions.CustomFixture>(output, fixture) {
[RetryFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kurrent.Client.Tests.PersistentSubscriptions;

[Trait("Category", "Target:PersistentSubscriptions")]
public class SubscribeToAllReturnsSubscriptionsToAllStreamTests(ITestOutputHelper output, KurrentTemporaryFixture fixture)
: KurrentTemporaryTests<KurrentTemporaryFixture>(output, fixture) {
[RetryFact]
Expand Down
Loading

0 comments on commit 4c238c7

Please sign in to comment.