Skip to content

Commit

Permalink
Merge pull request #12 from j4asper/11-fix-pipelines
Browse files Browse the repository at this point in the history
Added new workflows
  • Loading branch information
j4asper authored Nov 21, 2024
2 parents ea68eb4 + e50007e commit 9642833
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ name: Publish KanbanCord Docker Image
on:
release:
types: [published]
workflow_dispatch:

jobs:
build_and_test:
name: Build and Test Project
uses: j4asper/KanbanCord/.github/workflows/build-and-test.yml@main
test_project:
name: Build Project
uses: j4asper/KanbanCord/.github/workflows/unit-tests.yml@11-fix-pipelines

build_and_publish_bot_docker_image:
name: Build and Publish Bot Docker Image
runs-on: ubuntu-latest
needs: build_and_test
needs: test_project
steps:
- uses: actions/checkout@v4

Expand All @@ -25,8 +26,8 @@ jobs:
- name: Build Docker image
run: docker build -f ./Dockerfile --build-arg application_version=${{ github.ref_name }} -t ${{ secrets.DOCKER_USERNAME }}/kanbancord:${{ github.ref_name }} .

- name: Push to Registry
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/kanbancord:${{ github.ref_name }}
docker tag ${{ secrets.DOCKER_USERNAME }}/kanbancord:${{ github.ref_name }} ${{ secrets.DOCKER_USERNAME }}/kanbancord:latest
docker push ${{ secrets.DOCKER_USERNAME }}/kanbancord:latest
# - name: Push to Registry
# run: |
# docker push ${{ secrets.DOCKER_USERNAME }}/kanbancord:${{ github.ref_name }}
# docker tag ${{ secrets.DOCKER_USERNAME }}/kanbancord:${{ github.ref_name }} ${{ secrets.DOCKER_USERNAME }}/kanbancord:latest
# docker push ${{ secrets.DOCKER_USERNAME }}/kanbancord:latest
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Build and Test KanbanCord
name: Build Project

on:
pull_request:
branches:
- main
workflow_call:
workflow_dispatch:

jobs:
build_project:
Expand Down Expand Up @@ -34,28 +32,3 @@ jobs:
path: |
**/bin/Release/
**/obj/Release/
unit_tests:
name: Unit Tests
runs-on: ubuntu-latest
needs: build_project
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download build output
uses: actions/download-artifact@v3
with:
name: build-output
path: ./build-output

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore

- name: Test
run: dotnet test --no-build --verbosity normal --output ./build-output
35 changes: 35 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Unit Test Workflow

on:
workflow_call:
workflow_dispatch:

jobs:
build_project:
name: Build Project
uses: j4asper/KanbanCord/.github/workflows/build-project.yml@11-fix-pipelines

unit_tests:
name: Unit Tests
runs-on: ubuntu-latest
needs: build_project
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download build output
uses: actions/download-artifact@v3
with:
name: build-output
path: ./build-output

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore

- name: Test
run: dotnet test --no-build --verbosity normal

0 comments on commit 9642833

Please sign in to comment.