Skip to content

Commit

Permalink
'refactor' workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
thefringeninja committed May 2, 2024
1 parent d5bcc35 commit 7f50ecf
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 46 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@ name: Build

on:
workflow_call:
secrets:
CLOUDSMITH_CICD_USER:
required: false
CLOUDSMITH_CICD_TOKEN:
required: false
inputs:
docker-tag:
required: true
type: string
docker-registry:
required: false
type: string
default: docker.eventstore.com/eventstore-ce/eventstoredb-ce

jobs:
test:
Expand All @@ -19,15 +28,24 @@ jobs:
configuration: [ release ]
runs-on: ${{ matrix.os }}
name: EventStore.Client.${{ matrix.test }}/${{ matrix.os }}/${{ matrix.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 ${{ inputs.docker-registry }}:${{ inputs.docker-tag }}
- name: Install dotnet SDKs
uses: actions/setup-dotnet@v3
with:
Expand All @@ -43,6 +61,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 \
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
54 changes: 9 additions & 45 deletions .github/workflows/ee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,17 @@ 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 ]
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-tag: 24.2.0-jammy
docker-registry: docker.eventstore.com/eventstore-ee/eventstoredb-commercial
secrets:
CLOUDSMITH_CICD_USER: ${{ secrets.CLOUDSMITH_CICD_USER }}
CLOUDSMITH_CICD_TOKEN: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/previous-lts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
uses: ./.github/workflows/base.yml
with:
docker-tag: previous-lts

0 comments on commit 7f50ecf

Please sign in to comment.