diff --git a/.github/workflows/anubis-eval-cd.yaml b/.github/workflows/anubis-eval-cd.yaml deleted file mode 100644 index 740194f..0000000 --- a/.github/workflows/anubis-eval-cd.yaml +++ /dev/null @@ -1,94 +0,0 @@ -name: Anubis - Build Docker image and publish to GitHub Packages - -on: - push: - tags: - - "v*.*.*" - -# branches: -# - develop - - paths: - - "anubis-eval/**" - - ".github/workflows/anubis-eval-cd.yaml" - -# pull_request: -# branches: -# - develop -# -# paths: -# - "anubis-eval/**" -# - ".github/workflows/anubis-eval-cd.yaml" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: anubis-eval - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - working-directory: anubis-eval - - steps: - - uses: actions/checkout@v4 - - - name: Run docker-compose - uses: hoverkraft-tech/compose-action@v2.0.1 - 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 - - deploy: - runs-on: ubuntu-latest - needs: build - - permissions: - contents: read - packages: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: anubis-eval - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/anubis-eval-ci.yaml b/.github/workflows/anubis-eval-ci.yaml index 1c8383c..47abe93 100644 --- a/.github/workflows/anubis-eval-ci.yaml +++ b/.github/workflows/anubis-eval-ci.yaml @@ -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: @@ -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 }} diff --git a/.github/workflows/anubis-eval-pr-verify.yaml b/.github/workflows/anubis-eval-pr-verify.yaml new file mode 100644 index 0000000..5b6bc6e --- /dev/null +++ b/.github/workflows/anubis-eval-pr-verify.yaml @@ -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/compose-action@v2.0.1 + 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 diff --git a/.github/workflows/dapr-config-ci.yaml b/.github/workflows/dapr-config-ci.yaml new file mode 100644 index 0000000..a407702 --- /dev/null +++ b/.github/workflows/dapr-config-ci.yaml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/enki-problems-cd.yaml b/.github/workflows/enki-problems-cd.yaml deleted file mode 100644 index 685b2b0..0000000 --- a/.github/workflows/enki-problems-cd.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: Enki - Build Docker image and publish to GitHub Packages - -on: - push: - tags: - - "v*.*.*" - -# branches: -# - develop - - paths: - - "enki-problems/**" - - ".github/workflows/enki-problems-cd.yaml" - -# pull_request: -# branches: -# - develop -# -# paths: -# - "enki-problems/**" -# - ".github/workflows/enki-problems-cd.yaml" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: enki-problems - -jobs: - build: - 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 - - deploy: - runs-on: ubuntu-latest - needs: build - - permissions: - contents: read - packages: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: enki-problems - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/enki-problems-ci.yaml b/.github/workflows/enki-problems-ci.yaml index 454ef7f..c6d40fc 100644 --- a/.github/workflows/enki-problems-ci.yaml +++ b/.github/workflows/enki-problems-ci.yaml @@ -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: @@ -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 \ No newline at end of file + 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 }} diff --git a/.github/workflows/enki-problems-pr-verify.yaml b/.github/workflows/enki-problems-pr-verify.yaml new file mode 100644 index 0000000..fe115ef --- /dev/null +++ b/.github/workflows/enki-problems-pr-verify.yaml @@ -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 \ No newline at end of file diff --git a/.github/workflows/eval-lb-ci.yaml b/.github/workflows/eval-lb-ci.yaml new file mode 100644 index 0000000..82044d3 --- /dev/null +++ b/.github/workflows/eval-lb-ci.yaml @@ -0,0 +1,26 @@ +name: Eval Nginx Load Balancer - Build Docker image and publish to GHCR and Docker Hub + +on: + push: + tags: + - "eval-lb/**" + +env: + NAMESPACE: pantheonix + REPOSITORY: eval-lb + IMAGE_NAME: asgard-eval-lb + BUILD_CONTEXT: anubis-eval/eval-lb + +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 }} diff --git a/.github/workflows/eval-lb.yaml b/.github/workflows/eval-lb.yaml deleted file mode 100644 index 58ca852..0000000 --- a/.github/workflows/eval-lb.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: Eval Nginx Load Balancer - Build Docker image and publish to GitHub Packages - -on: - push: - tags: - - "v*.*.*" - -# branches: -# - develop - - paths: - - "anubis-eval/eval-lb/**" - - ".github/workflows/eval-lb.yaml" - -# pull_request: -# branches: -# - develop -# -# paths: -# - "anubis-eval/eval-lb/**" -# - ".github/workflows/eval-lb.yaml" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: asgard-eval-lb - -jobs: - build: - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: anubis-eval/eval-lb - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/hermes-tests-cd.yaml b/.github/workflows/hermes-tests-cd.yaml deleted file mode 100644 index 2f5dd99..0000000 --- a/.github/workflows/hermes-tests-cd.yaml +++ /dev/null @@ -1,87 +0,0 @@ -name: Hermes - Build Docker image and publish to GitHub Packages - -on: - push: - tags: - - "v*.*.*" - -# branches: -# - develop - - paths: - - "hermes-tests/**" - - ".github/workflows/hermes-tests-cd.yaml" - -# pull_request: -# branches: -# - develop -# -# paths: -# - "hermes-tests/**" -# - ".github/workflows/hermes-tests-cd.yaml" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: hermes-tests - HERMES_CONFIG: ${{ secrets.HERMES_CONFIG }} - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - working-directory: hermes-tests - - steps: - - uses: actions/checkout@v4 - - - name: Setup dart - uses: dart-lang/setup-dart@v1 - with: - sdk: 2.19.2 - - - name: Create logs/test.log file - run: | - mkdir -p logs - touch logs/test.log - - - name: Get dependencies - run: dart pub get - - - name: Test - run: dart test - - deploy: - runs-on: ubuntu-latest - needs: build - - permissions: - contents: read - packages: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: hermes-tests - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/hermes-tests-ci.yaml b/.github/workflows/hermes-tests-ci.yaml index 5c1cdf3..c4a59aa 100644 --- a/.github/workflows/hermes-tests-ci.yaml +++ b/.github/workflows/hermes-tests-ci.yaml @@ -1,21 +1,20 @@ -name: Hermes - Build and Test Tests Service +name: Hermes - Build Docker image and publish to GHCR and Docker Hub on: push: - paths: - - "hermes-tests/**" - - ".github/workflows/hermes-tests-ci.yaml" - - pull_request: - paths: - - "hermes-tests/**" - - ".github/workflows/hermes-tests-ci.yaml" + tags: + - "hermes/**" env: + NAMESPACE: pantheonix + REPOSITORY: hermes + IMAGE_NAME: hermes-tests + BUILD_CONTEXT: hermes-tests HERMES_CONFIG: ${{ secrets.HERMES_CONFIG }} jobs: build: + name: Build and Test Hermes Tests Microservice runs-on: ubuntu-latest defaults: run: @@ -39,3 +38,18 @@ jobs: - name: Test run: dart test + + 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 }} diff --git a/.github/workflows/hermes-tests-pr-verify.yaml b/.github/workflows/hermes-tests-pr-verify.yaml new file mode 100644 index 0000000..c1fcefd --- /dev/null +++ b/.github/workflows/hermes-tests-pr-verify.yaml @@ -0,0 +1,39 @@ +name: Hermes - PR Verify + +on: + pull_request: + branches: + - develop + paths: + - "hermes-tests/**" + - ".github/workflows/hermes-tests-pr-verify.yaml" + +env: + HERMES_CONFIG: ${{ secrets.HERMES_CONFIG }} + +jobs: + build: + name: Build and Test Hermes Tests Microservice + runs-on: ubuntu-latest + defaults: + run: + working-directory: hermes-tests + + steps: + - uses: actions/checkout@v4 + + - name: Setup dart + uses: dart-lang/setup-dart@v1 + with: + sdk: 2.19.2 + + - name: Create logs/test.log file + run: | + mkdir -p logs + touch logs/test.log + + - name: Get dependencies + run: dart pub get + + - name: Test + run: dart test \ No newline at end of file diff --git a/.github/workflows/odin-gateway-ci.yaml b/.github/workflows/odin-gateway-ci.yaml new file mode 100644 index 0000000..b5e5484 --- /dev/null +++ b/.github/workflows/odin-gateway-ci.yaml @@ -0,0 +1,27 @@ +name: Odin - Build Docker image and publish to GHCR and Docker Hub + +on: + push: + tags: + - "odin/**" + +env: + NAMESPACE: pantheonix + REPOSITORY: odin + IMAGE_NAME: odin-api-gateway + BUILD_CONTEXT: odin-gateway + +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 }} + diff --git a/.github/workflows/odin-gateway.yaml b/.github/workflows/odin-gateway.yaml deleted file mode 100644 index f2414bf..0000000 --- a/.github/workflows/odin-gateway.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: Odin - Build Docker image and publish to GitHub Packages - -on: - push: - tags: - - "v*.*.*" - -# branches: -# - develop - - paths: - - "odin-gateway/**" - - ".github/workflows/odin-gateway.yaml" - -# pull_request: -# branches: -# - develop -# -# paths: -# - "odin-gateway/**" -# - ".github/workflows/odin-gateway.yaml" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: odin-api-gateway - -jobs: - build: - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: odin-gateway - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/quetzalcoatl-auth-cd.yaml b/.github/workflows/quetzalcoatl-auth-cd.yaml deleted file mode 100644 index 01af917..0000000 --- a/.github/workflows/quetzalcoatl-auth-cd.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: Quetzalcoatl - Build Docker image and publish to GitHub Packages - -on: - push: - tags: - - "v*.*.*" - -# branches: -# - develop - - paths: - - "quetzalcoatl-auth/**" - - ".github/workflows/quetzalcoatl-auth-cd.yaml" - -# pull_request: -# branches: -# - develop -# -# paths: -# - "quetzalcoatl-auth/**" -# - ".github/workflows/quetzalcoatl-auth-cd.yaml" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: quetzalcoatl-auth - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - working-directory: quetzalcoatl-auth - - steps: - - uses: actions/checkout@v4 - - name: Setup dotnet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '7.0.x' - - name: Build - run: | - dotnet restore "Bootstrapper/Bootstrapper.csproj" - dotnet restore "Tests.Integration/Tests.Integration.csproj" - dotnet build --no-restore - - name: Test - run: dotnet test -e ASPNETCORE_ENVIRONMENT=Testing "Tests.Integration/Tests.Integration.csproj" - - deploy: - runs-on: ubuntu-latest - needs: build - - permissions: - contents: read - packages: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: quetzalcoatl-auth - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/quetzalcoatl-auth-ci.yaml b/.github/workflows/quetzalcoatl-auth-ci.yaml index e7af4b9..aba5d5d 100644 --- a/.github/workflows/quetzalcoatl-auth-ci.yaml +++ b/.github/workflows/quetzalcoatl-auth-ci.yaml @@ -1,18 +1,19 @@ -name: Quetzalcoatl - Build and Test Auth Service +name: Quetzalcoatl - Build Docker image and publish to GHCR and Docker Hub on: push: - paths: - - "quetzalcoatl-auth/**" - - ".github/workflows/quetzalcoatl-auth-ci.yaml" + tags: + - "quetzalcoatl/**" - pull_request: - paths: - - "quetzalcoatl-auth/**" - - ".github/workflows/quetzalcoatl-auth-ci.yaml" +env: + NAMESPACE: pantheonix + REPOSITORY: quetzalcoatl + IMAGE_NAME: quetzalcoatl-auth + BUILD_CONTEXT: quetzalcoatl-auth jobs: build: + name: Build and Test Quetzalcoatl Auth Microservice runs-on: ubuntu-latest defaults: run: @@ -29,5 +30,20 @@ jobs: dotnet restore "Bootstrapper/Bootstrapper.csproj" dotnet restore "Tests.Integration/Tests.Integration.csproj" dotnet build --no-restore - - name: Test - run: dotnet test -e ASPNETCORE_ENVIRONMENT=Testing "Tests.Integration/Tests.Integration.csproj" \ No newline at end of file +# - name: Test +# run: dotnet test -e ASPNETCORE_ENVIRONMENT=Testing "Tests.Integration/Tests.Integration.csproj" + + 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 }} diff --git a/.github/workflows/quetzalcoatl-auth-pr-verify.yaml b/.github/workflows/quetzalcoatl-auth-pr-verify.yaml new file mode 100644 index 0000000..c0b2131 --- /dev/null +++ b/.github/workflows/quetzalcoatl-auth-pr-verify.yaml @@ -0,0 +1,31 @@ +name: Quetzalcoatl - PR Verify + +on: + pull_request: + branches: + - develop + paths: + - "quetzalcoatl-auth/**" + - ".github/workflows/quetzalcoatl-auth-pr-verify.yaml" + +jobs: + build: + name: Build and Test Quetzalcoatl Auth Microservice + runs-on: ubuntu-latest + defaults: + run: + working-directory: quetzalcoatl-auth + + steps: + - uses: actions/checkout@v4 + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '7.0.x' + - name: Build + run: | + dotnet restore "Bootstrapper/Bootstrapper.csproj" + dotnet restore "Tests.Integration/Tests.Integration.csproj" + dotnet build --no-restore +# - name: Test +# run: dotnet test -e ASPNETCORE_ENVIRONMENT=Testing "Tests.Integration/Tests.Integration.csproj" \ No newline at end of file diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..2dc79d9 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,20 @@ +name: Release Please + +on: + push: + branches: + - develop + +permissions: + contents: read + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.github/workflows/step-deploy-to-docker-hub.yaml b/.github/workflows/step-deploy-to-docker-hub.yaml new file mode 100644 index 0000000..9bfd034 --- /dev/null +++ b/.github/workflows/step-deploy-to-docker-hub.yaml @@ -0,0 +1,47 @@ +name: "Step - Push Docker image to Docker Hub Registry" + +on: + workflow_call: + inputs: + namespace: + type: string + required: true + repository: + type: string + required: true + build_context: + type: string + required: true + +jobs: + deploy: + name: "Deploy to Docker Hub" + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ inputs.namespace }}/${{ inputs.repository }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: ${{ inputs.build_context }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/dapr-config.yaml b/.github/workflows/step-deploy-to-ghcr.yaml similarity index 54% rename from .github/workflows/dapr-config.yaml rename to .github/workflows/step-deploy-to-ghcr.yaml index 21f18d3..e3e69e5 100644 --- a/.github/workflows/dapr-config.yaml +++ b/.github/workflows/step-deploy-to-ghcr.yaml @@ -1,31 +1,18 @@ -name: Dapr - Build Docker image and publish to GitHub Packages +name: "Step - Push Docker image to GitHub Container Registry (GHCR)" on: - push: - tags: - - "v*.*.*" - -# branches: -# - develop - - paths: - - "dapr/**" - - ".github/workflows/dapr-config.yaml" - -# pull_request: -# branches: -# - develop -# -# paths: -# - "dapr-config/**" -# - ".github/workflows/dapr-config.yaml" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: asgard-dapr-config + workflow_call: + inputs: + image_name: + type: string + required: true + build_context: + type: string + required: true jobs: - build: + deploy: + name: "Deploy to GHCR" runs-on: ubuntu-latest permissions: @@ -39,7 +26,7 @@ jobs: - name: Log in to the Container registry uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} + registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.TOKEN }} @@ -47,14 +34,14 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }} tags: | type=semver,pattern={{version}} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: - context: dapr + context: ${{ inputs.build_context }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..65251c0 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,9 @@ +{ + "quetzalcoatl": "2.0.0", + "enki": "2.0.0", + "hermes": "2.0.0", + "anubis": "2.0.0", + "odin": "2.0.0", + "dapr": "2.0.0", + "eval-lb": "2.0.0" +} \ No newline at end of file diff --git a/quetzalcoatl-auth/Tests.Integration/Core/ApiWebFactory.cs b/quetzalcoatl-auth/Tests.Integration/Core/ApiWebFactory.cs index e583a3a..8979f5e 100644 --- a/quetzalcoatl-auth/Tests.Integration/Core/ApiWebFactory.cs +++ b/quetzalcoatl-auth/Tests.Integration/Core/ApiWebFactory.cs @@ -1,9 +1,11 @@ +using DotNet.Testcontainers.Builders; + namespace Tests.Integration.Core; public class ApiWebFactory : WebApplicationFactory, IAsyncLifetime { private readonly MsSqlContainer _database = new MsSqlBuilder() - .WithImage("mcr.microsoft.com/mssql/server:2022-latest") + .WithImage("mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04") .Build(); protected override void ConfigureWebHost(IWebHostBuilder builder) diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..2b23780 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,37 @@ +{ + "include-component-in-tag": true, + "include-v-in-tag": true, + "tag-separator": "@", + "separate-pull-requests": true, + "packages": { + "quetzalcoatl": { + "path": "quetzalcoatl-auth", + "release-type": "simple" + }, + "enki": { + "path": "enki-problems", + "release-type": "simple" + }, + "hermes": { + "path": "hermes-tests", + "release-type": "dart" + }, + "anubis": { + "path": "anubis-eval", + "release-type": "rust" + }, + "odin": { + "path": "odin-gateway", + "release-type": "simple" + }, + "dapr": { + "path": "dapr", + "release-type": "simple" + }, + "eval-lb": { + "path": "anubis-eval/eval-lb", + "release-type": "simple" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} \ No newline at end of file