Skip to content

Commit

Permalink
Fix Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAxelander committed Oct 29, 2024
1 parent b5371e9 commit 5de7baa
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/docker-image-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ jobs:
test:
runs-on: ubuntu-latest
name: Run Test Cases
services:
mariadb:
image: mariadb:latest
ports:
- 3306:3306
env:
MARIADB_DATABASE: openbudgeteer
MARIADB_USER: openbudgeteer
MARIADB_PASSWORD: openbudgeteer
MARIADB_ROOT_PASSWORD: openbudgeteer
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Check out repo
uses: actions/checkout@v3
Expand All @@ -27,7 +43,15 @@ jobs:
run: dotnet build OpenBudgeteer.Blazor --configuration Release --no-restore

- name: Run Core Test Cases
env:
CONNECTION_PROVIDER: mariadb
CONNECTION_SERVER: localhost
CONNECTION_PORT: 3306
CONNECTION_USER: openbudgeteer
CONNECTION_PASSWORD: openbudgeteer
CONNECTION_DATABASE: openbudgeteer
run: dotnet test OpenBudgeteer.Core.Test

deploy-docker-app:
runs-on: ubuntu-latest
name: Build and Push Docker Image (App)
Expand Down Expand Up @@ -56,6 +80,7 @@ jobs:
push: true
tags: axelander/openbudgeteer:latest
platforms: linux/arm64,linux/amd64

deploy-docker-api:
runs-on: ubuntu-latest
name: Build and Push Docker Image (API)
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/docker-image-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
MARIADB_DATABASE: openbudgeteer
MARIADB_USER: openbudgeteer
MARIADB_PASSWORD: openbudgeteer
MARIADB_ROOT_PASSWORD: openbudgeteer
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Check out repo
Expand All @@ -37,22 +43,16 @@ jobs:
- name: Build Blazor
run: dotnet build OpenBudgeteer.Blazor --configuration Release --no-restore

- name: Wait for MariaDB to be ready
run: |
docker ps
while ! docker exec -i $(docker ps -q -f ancestor=mariadb:latest) mariadb -u openbudgeteer -p openbudgeteer -e "SHOW DATABASES"; do
echo "Waiting for MariaDB..."
sleep 3
done
- name: Run Core Test Cases
env:
CONNECTION_SERVER: mariadb
CONNECTION_PROVIDER: mariadb
CONNECTION_SERVER: localhost
CONNECTION_PORT: 3306
CONNECTION_USER: openbudgeteer
CONNECTION_PASSWORD: openbudgeteer
CONNECTION_DATABASE: openbudgeteer
run: dotnet test OpenBudgeteer.Core.Test

deploy-docker-app:
runs-on: ubuntu-latest
name: Build and Push Docker Image (App)
Expand Down Expand Up @@ -81,6 +81,7 @@ jobs:
push: true
tags: axelander/openbudgeteer:pre-release
platforms: linux/arm64,linux/amd64

deploy-docker-api:
runs-on: ubuntu-latest
name: Build and Push Docker Image (API)
Expand Down

0 comments on commit 5de7baa

Please sign in to comment.