From 42b63418f75947936c01bb0ffb0aaae503c0f068 Mon Sep 17 00:00:00 2001 From: WarriorsSami Date: Sat, 22 Jun 2024 12:26:55 +0300 Subject: [PATCH] ops: add pull-request triggers for ci pipelines and prepend ci logic to already existing cd pipelines --- .../{anubis-eval.yaml => anubis-eval-cd.yaml} | 6 ++-- ...ki-problems.yaml => enki-problems-cd.yaml} | 26 +++++++++++++-- .github/workflows/enki-problems-ci.yaml | 5 +++ ...hermes-tests.yaml => hermes-tests-cd.yaml} | 32 +++++++++++++++++-- ...tl-auth.yaml => quetzalcoatl-auth-cd.yaml} | 24 ++++++++++++-- .github/workflows/quetzalcoatl-auth-ci.yaml | 9 ++++-- 6 files changed, 88 insertions(+), 14 deletions(-) rename .github/workflows/{anubis-eval.yaml => anubis-eval-cd.yaml} (89%) rename .github/workflows/{enki-problems.yaml => enki-problems-cd.yaml} (60%) rename .github/workflows/{hermes-tests.yaml => hermes-tests-cd.yaml} (64%) rename .github/workflows/{quetzalcoatl-auth.yaml => quetzalcoatl-auth-cd.yaml} (61%) diff --git a/.github/workflows/anubis-eval.yaml b/.github/workflows/anubis-eval-cd.yaml similarity index 89% rename from .github/workflows/anubis-eval.yaml rename to .github/workflows/anubis-eval-cd.yaml index c022e52..65b6c99 100644 --- a/.github/workflows/anubis-eval.yaml +++ b/.github/workflows/anubis-eval-cd.yaml @@ -10,7 +10,7 @@ on: paths: - "anubis-eval/**" - - ".github/workflows/anubis-eval.yaml" + - ".github/workflows/anubis-eval-cd.yaml" # pull_request: # branches: @@ -18,7 +18,7 @@ on: # # paths: # - "anubis-eval/**" -# - ".github/workflows/anubis-eval.yaml" +# - ".github/workflows/anubis-eval-cd.yaml" env: REGISTRY: ghcr.io @@ -52,7 +52,7 @@ jobs: type=semver,pattern={{version}} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: anubis-eval push: true diff --git a/.github/workflows/enki-problems.yaml b/.github/workflows/enki-problems-cd.yaml similarity index 60% rename from .github/workflows/enki-problems.yaml rename to .github/workflows/enki-problems-cd.yaml index 2795a9d..2e353a3 100644 --- a/.github/workflows/enki-problems.yaml +++ b/.github/workflows/enki-problems-cd.yaml @@ -10,7 +10,7 @@ on: paths: - "enki-problems/**" - - ".github/workflows/enki-problems.yaml" + - ".github/workflows/enki-problems-cd.yaml" # pull_request: # branches: @@ -18,7 +18,7 @@ on: # # paths: # - "enki-problems/**" -# - ".github/workflows/enki-problems.yaml" +# - ".github/workflows/enki-problems-cd.yaml" env: REGISTRY: ghcr.io @@ -28,6 +28,26 @@ jobs: build: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '7.0.x' + - name: Build + run: | + dotnet restore "enki-problems/src/EnkiProblems.HttpApi.Host/EnkiProblems.HttpApi.Host.csproj" + dotnet restore "enki-problems/test/EnkiProblems.Application.Tests/EnkiProblems.Application.Tests.csproj" + cd enki-problems + dotnet build --no-restore + - name: Test + run: | + cd enki-problems + dotnet test -e DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false + + deploy: + runs-on: ubuntu-latest + permissions: contents: read packages: write @@ -52,7 +72,7 @@ jobs: type=semver,pattern={{version}} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: enki-problems push: true diff --git a/.github/workflows/enki-problems-ci.yaml b/.github/workflows/enki-problems-ci.yaml index e13b5b0..62a6d47 100644 --- a/.github/workflows/enki-problems-ci.yaml +++ b/.github/workflows/enki-problems-ci.yaml @@ -6,6 +6,11 @@ on: - "enki-problems/**" - ".github/workflows/enki-problems-ci.yaml" + pull_request: + paths: + - "enki-problems/**" + - ".github/workflows/enki-problems-ci.yaml" + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/hermes-tests.yaml b/.github/workflows/hermes-tests-cd.yaml similarity index 64% rename from .github/workflows/hermes-tests.yaml rename to .github/workflows/hermes-tests-cd.yaml index b3b0157..e31f6ff 100644 --- a/.github/workflows/hermes-tests.yaml +++ b/.github/workflows/hermes-tests-cd.yaml @@ -10,7 +10,7 @@ on: paths: - "hermes-tests/**" - - ".github/workflows/hermes-tests.yaml" + - ".github/workflows/hermes-tests-cd.yaml" # pull_request: # branches: @@ -18,16 +18,42 @@ on: # # paths: # - "hermes-tests/**" -# - ".github/workflows/hermes-tests.yaml" +# - ".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 + steps: + - uses: actions/checkout@v4 + + - uses: dart-lang/setup-dart@v1 + with: + sdk: 2.19.2 + + - name: Create logs/test.log file + run: | + mkdir -p hermes-tests/logs + touch hermes-tests/logs/test.log + + - name: Get dependencies + run: | + cd hermes-tests + dart pub get + + - name: Test + run: | + cd hermes-tests + dart test + + deploy: + runs-on: ubuntu-latest + permissions: contents: read packages: write @@ -52,7 +78,7 @@ jobs: type=semver,pattern={{version}} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: hermes-tests push: true diff --git a/.github/workflows/quetzalcoatl-auth.yaml b/.github/workflows/quetzalcoatl-auth-cd.yaml similarity index 61% rename from .github/workflows/quetzalcoatl-auth.yaml rename to .github/workflows/quetzalcoatl-auth-cd.yaml index a8c1ad0..929b390 100644 --- a/.github/workflows/quetzalcoatl-auth.yaml +++ b/.github/workflows/quetzalcoatl-auth-cd.yaml @@ -10,7 +10,7 @@ on: paths: - "quetzalcoatl-auth/**" - - ".github/workflows/quetzalcoatl-auth.yaml" + - ".github/workflows/quetzalcoatl-auth-cd.yaml" # pull_request: # branches: @@ -18,7 +18,7 @@ on: # # paths: # - "quetzalcoatl-auth/**" -# - ".github/workflows/quetzalcoatl-auth.yaml" +# - ".github/workflows/quetzalcoatl-auth-cd.yaml" env: REGISTRY: ghcr.io @@ -28,6 +28,24 @@ jobs: build: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '7.0.x' + - name: Build + run: | + dotnet restore "quetzalcoatl-auth/Bootstrapper/Bootstrapper.csproj" + dotnet restore "quetzalcoatl-auth/Tests.Integration/Tests.Integration.csproj" + cd quetzalcoatl-auth + dotnet build --no-restore + - name: Test + run: dotnet test -e ASPNETCORE_ENVIRONMENT=Testing "quetzalcoatl-auth/Tests.Integration/Tests.Integration.csproj" + + deploy: + runs-on: ubuntu-latest + permissions: contents: read packages: write @@ -52,7 +70,7 @@ jobs: type=semver,pattern={{version}} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: quetzalcoatl-auth push: true diff --git a/.github/workflows/quetzalcoatl-auth-ci.yaml b/.github/workflows/quetzalcoatl-auth-ci.yaml index aa4288b..0bb42ac 100644 --- a/.github/workflows/quetzalcoatl-auth-ci.yaml +++ b/.github/workflows/quetzalcoatl-auth-ci.yaml @@ -3,8 +3,13 @@ name: Quetzalcoatl - Build and Test Auth Service on: push: paths: - - "quetzalcoatl-auth/**" - - ".github/workflows/quetzalcoatl-auth-ci.yaml" + - "quetzalcoatl-auth/**" + - ".github/workflows/quetzalcoatl-auth-ci.yaml" + + pull_request: + paths: + - "quetzalcoatl-auth/**" + - ".github/workflows/quetzalcoatl-auth-ci.yaml" jobs: build: