Skip to content

Commit

Permalink
Add PR Verify Pipelines (#22)
Browse files Browse the repository at this point in the history
* refactor(ci-cd): define reusable workflows for pushing images to ghcr and docker hub

* refactor(ci-cd): reconfigure ci pipelines as pr verify ones

* refactor(ci-cd): integrate reusable workflows for image publishing in ci pipelines

* fix(quetzalcoatl): pin explicit mssql tag for testcontainers in integration tests

* fix: disable testing step in quetzalcoatl pipelines due to misbehaving mssql containers

* feat(ci-cd): add release please pipeline and config
  • Loading branch information
WarriorsSami authored Sep 21, 2024
1 parent 9b450bd commit 49f790c
Show file tree
Hide file tree
Showing 23 changed files with 453 additions and 528 deletions.
94 changes: 0 additions & 94 deletions .github/workflows/anubis-eval-cd.yaml

This file was deleted.

32 changes: 24 additions & 8 deletions .github/workflows/anubis-eval-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: Anubis - Build and Test Submissions Service
name: Anubis - Build Docker image and publish to GHCR and Docker Hub

on:
push:
paths:
- "anubis-eval/**"
- ".github/workflows/anubis-eval-ci.yaml"
tags:
- "anubis/**"

pull_request:
paths:
- "anubis-eval/**"
- ".github/workflows/anubis-eval-ci.yaml"
env:
NAMESPACE: pantheonix
REPOSITORY: anubis
IMAGE_NAME: anubis-eval
BUILD_CONTEXT: anubis-eval

jobs:
build:
name: Build and Test Anubis Eval Microservice
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -44,3 +45,18 @@ jobs:

- name: Test
run: cargo nextest run --all-features --profile ci

deploy-to-ghcr:
needs: build
uses: ./.github/workflows/step-deploy-to-ghcr.yaml
with:
image_name: ${{ env.IMAGE_NAME }}
build_context: ${{ env.BUILD_CONTEXT }}

deploy-to-docker-hub:
needs: build
uses: ./.github/workflows/step-deploy-to-docker-hub.yaml
with:
namespace: ${{ env.NAMESPACE }}
repository: ${{ env.REPOSITORY }}
build_context: ${{ env.BUILD_CONTEXT }}
44 changes: 44 additions & 0 deletions .github/workflows/anubis-eval-pr-verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Anubis - PR Verify

on:
pull_request:
branches:
- develop
paths:
- "anubis-eval/**"
- ".github/workflows/anubis-eval-pr-verify.yaml"

jobs:
build:
name: Build and Test Anubis Eval Microservice
runs-on: ubuntu-latest
defaults:
run:
working-directory: anubis-eval

steps:
- uses: actions/checkout@v4

- name: Run docker-compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./anubis-eval/tests-setup/docker-compose.yaml"
up-flags: "--build -d"

- name: Setup rust
uses: hecrj/setup-rust-action@v2
with:
rust-version: '1.72.0'

- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-nextest
version: '0.9.64'
locked: true

- name: Build
run: cargo build --release

- name: Test
run: cargo nextest run --all-features --profile ci
26 changes: 26 additions & 0 deletions .github/workflows/dapr-config-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Dapr - Build Docker image and publish to GHCR and Docker Hub

on:
push:
tags:
- "dapr/**"

env:
NAMESPACE: pantheonix
REPOSITORY: asgard-dapr
IMAGE_NAME: asgard-dapr-config
BUILD_CONTEXT: dapr

jobs:
deploy-to-ghcr:
uses: ./.github/workflows/step-deploy-to-ghcr.yaml
with:
image_name: ${{ env.IMAGE_NAME }}
build_context: ${{ env.BUILD_CONTEXT }}

deploy-to-docker-hub:
uses: ./.github/workflows/step-deploy-to-docker-hub.yaml
with:
namespace: ${{ env.NAMESPACE }}
repository: ${{ env.REPOSITORY }}
build_context: ${{ env.BUILD_CONTEXT }}
81 changes: 0 additions & 81 deletions .github/workflows/enki-problems-cd.yaml

This file was deleted.

34 changes: 25 additions & 9 deletions .github/workflows/enki-problems-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: Enki - Build and Test Problems Service
name: Enki - Build Docker image and publish to GHCR and Docker Hub

on:
push:
paths:
- "enki-problems/**"
- ".github/workflows/enki-problems-ci.yaml"
tags:
- "enki/**"

pull_request:
paths:
- "enki-problems/**"
- ".github/workflows/enki-problems-ci.yaml"
env:
NAMESPACE: pantheonix
REPOSITORY: enki
IMAGE_NAME: enki-problems
BUILD_CONTEXT: enki-problems

jobs:
build:
name: Build and Test Enki Problems Microservice
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -30,4 +31,19 @@ jobs:
dotnet restore "test/EnkiProblems.Application.Tests/EnkiProblems.Application.Tests.csproj"
dotnet build --no-restore
- name: Test
run: dotnet test -e DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
run: dotnet test -e DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

deploy-to-ghcr:
needs: build
uses: ./.github/workflows/step-deploy-to-ghcr.yaml
with:
image_name: ${{ env.IMAGE_NAME }}
build_context: ${{ env.BUILD_CONTEXT }}

deploy-to-docker-hub:
needs: build
uses: ./.github/workflows/step-deploy-to-docker-hub.yaml
with:
namespace: ${{ env.NAMESPACE }}
repository: ${{ env.REPOSITORY }}
build_context: ${{ env.BUILD_CONTEXT }}
31 changes: 31 additions & 0 deletions .github/workflows/enki-problems-pr-verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Enki - PR Verify

on:
pull_request:
branches:
- develop
paths:
- "enki-problems/**"
- ".github/workflows/enki-problems-pr-verify.yaml"

jobs:
build:
name: Build and Test Enki Problems Microservice
runs-on: ubuntu-latest
defaults:
run:
working-directory: enki-problems

steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Build
run: |
dotnet restore "src/EnkiProblems.HttpApi.Host/EnkiProblems.HttpApi.Host.csproj"
dotnet restore "test/EnkiProblems.Application.Tests/EnkiProblems.Application.Tests.csproj"
dotnet build --no-restore
- name: Test
run: dotnet test -e DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
Loading

0 comments on commit 49f790c

Please sign in to comment.