Skip to content

Commit

Permalink
Polish CI pipelines for building/testing and testing environments (#19)
Browse files Browse the repository at this point in the history
* ops(ci): add ci pipelines for building and testing quetzalcoatl and enki

* fix(ci): remove caching layer from quetzalcoatl and enki pipelines

* fix(ci): cd into quetzalcoatl and enki microservices projects before executing pipelines

* fix(ci): pwd for quetzalcoatl in pipeline

* fix(ci-quetzalcoatl): specify path to project when building and testing

* fix(ci-quetzalcoatl): restore tests project too

* misc(quetzalcoatl): update .net sdk to 8 (and packages too)

* fix(quetzalcoatl): configure testing environment

* fix+test(quetzalcoatl): remove obsolete tests and add new type formatters for response parsing

* fix(quetzalcoatl): configure testing environment for ci pipeline

* fix(quetzalcoatl): use .net 8 sdk in ci pipeline

* fix(quetzalcoatl): downgrade back to .net 7 as authorization failed to work in .net 8

* test(quetzalcoatl): remove seed data for get all users test

* style: format code

* fix(quetzalcoatl): enable MARS for mssql dsn in integration tests

* style: remove debuggin prints

* fix+ops(enki): prepare test environment for ci pipeline

* ops(hermes): setup testing environment for ci pipeline

* fix(hermes): remove format and analyze steps from ci pipeline

* fix(hermes): cd into microservice project before running tests

* fix(hermes): create log file for tests

* ops: add pull-request triggers for ci pipelines and prepend ci logic to already existing cd pipelines

* ops(anubis): setup ci pipeline for testing

* refactor+ops: specify project dir as default per pipeline

* fix(anubis): place cache action after rust setup in ci pipeline

* fix(quetzalcoatl): specify path to test project .csproj in the testing action of the ci pipeline

* test+ops(anubis): setup local environment for integration testing using docker compose

* fix(anubis): use correct path to testing environment compose in ci pipeline

* test(anubis): setup seeding data for integration tests

* test(anubis): setup cache stub as go CRUD API wrapper over Redis for integration testing

* test(anubis): add tests for get submission(s) endpoints and setup nextest

* ops(anubis): specify nextest version to be compatible with rustc version in ci pipeline

* ops(anubis): specify nextest version to be compatible with rustc version in ci pipeline

* test(anubis): add tests for get the highest score submissions and create submission endpoints

* ops: disable digitalocean deployment pipeline

ops: disable digitalocean deployment pipeline

ops: disable digitalocean deployment pipeline

---------

Co-authored-by: WarriorsSami <nicusor.barbut.v4j@student.ucv.ro>
  • Loading branch information
WarriorsSami and WarriorsSami authored Jul 3, 2024
1 parent 887000f commit bb7305a
Show file tree
Hide file tree
Showing 135 changed files with 3,213 additions and 1,060 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:

paths:
- "anubis-eval/**"
- ".github/workflows/anubis-eval.yaml"
- ".github/workflows/anubis-eval-cd.yaml"

# pull_request:
# branches:
# - develop
#
# paths:
# - "anubis-eval/**"
# - ".github/workflows/anubis-eval.yaml"
# - ".github/workflows/anubis-eval-cd.yaml"

env:
REGISTRY: ghcr.io
Expand All @@ -27,6 +27,32 @@ env:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: anubis-eval

steps:
- uses: actions/checkout@v4

- 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
locked: true

- name: Build
run: cargo build --release

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

deploy:
runs-on: ubuntu-latest

permissions:
contents: read
Expand All @@ -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: anubis-eval
push: true
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/anubis-eval-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Anubis - Build and Test Submissions Service

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

pull_request:
paths:
- "anubis-eval/**"
- ".github/workflows/anubis-eval-ci.yaml"

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
41 changes: 0 additions & 41 deletions .github/workflows/asgard-deploy.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:

paths:
- "enki-problems/**"
- ".github/workflows/enki-problems.yaml"
- ".github/workflows/enki-problems-cd.yaml"

# pull_request:
# branches:
# - develop
#
# paths:
# - "enki-problems/**"
# - ".github/workflows/enki-problems.yaml"
# - ".github/workflows/enki-problems-cd.yaml"

env:
REGISTRY: ghcr.io
Expand All @@ -27,6 +27,26 @@ env:
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

permissions:
contents: read
Expand All @@ -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
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/enki-problems-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Enki - Build and Test Problems Service

on:
push:
paths:
- "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
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,49 @@ on:

paths:
- "hermes-tests/**"
- ".github/workflows/hermes-tests.yaml"
- ".github/workflows/hermes-tests-cd.yaml"

# pull_request:
# branches:
# - develop
#
# 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
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

permissions:
contents: read
Expand All @@ -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
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/hermes-tests-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Hermes - Build and Test Tests Service

on:
push:
paths:
- "hermes-tests/**"
- ".github/workflows/hermes-tests-ci.yaml"

pull_request:
paths:
- "hermes-tests/**"
- ".github/workflows/hermes-tests-ci.yaml"

env:
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:

paths:
- "quetzalcoatl-auth/**"
- ".github/workflows/quetzalcoatl-auth.yaml"
- ".github/workflows/quetzalcoatl-auth-cd.yaml"

# pull_request:
# branches:
# - develop
#
# paths:
# - "quetzalcoatl-auth/**"
# - ".github/workflows/quetzalcoatl-auth.yaml"
# - ".github/workflows/quetzalcoatl-auth-cd.yaml"

env:
REGISTRY: ghcr.io
Expand All @@ -27,6 +27,26 @@ env:
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

permissions:
contents: read
Expand All @@ -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: quetzalcoatl-auth
push: true
Expand Down
Loading

0 comments on commit bb7305a

Please sign in to comment.