Skip to content

ci-cd: reduce runtime & e2e suite logic to have manual trigger #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: feat/develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 31 additions & 11 deletions .github/workflows/test.yaml → .github/workflows/e2e-suite.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
name: Test Nixopus API
name: E2E Test Nixopus API

on:
push:
branches:
- 'master'
- 'feat/develop'
- "master"
- "main"
- "feat/develop"
paths:
- 'api/**'
- "api/**/*.go"
- "api/**/*.yaml"
- "api/**/*.yml"
- "api/**/*.sql"
pull_request:
branches:
- "master"
- "main"
- "feat/develop"
paths:
- "api/**/*.go"
- "api/**/*.yaml"
- "api/**/*.yml"
- "api/**/*.sql"
workflow_dispatch:
inputs:
branch:
description: "Custom branch to run the E2E tests on"
required: true
default: "main"

jobs:
test:
e2e-suite:
runs-on: ubuntu-latest
services:
test-db:
Expand All @@ -28,17 +48,17 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: "1.23.4"
check-latest: true
cache: true
cache-dependency-path: api/go.sum

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Wait for PostgreSQL
run: |
for i in {1..10}; do
Expand All @@ -51,7 +71,7 @@ jobs:
done
echo "PostgreSQL failed to start"
exit 1

- name: Build and run tests
env:
DB_HOST: localhost
Expand All @@ -60,4 +80,4 @@ jobs:
DB_PASSWORD: nixopus
DB_NAME: nixopus_test
run: |
cd api && make test
cd api && make test-all
20 changes: 15 additions & 5 deletions .github/workflows/greetings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ on: [pull_request_target, issues]

jobs:
greeting:
if: |
github.event_name == 'issues' || (
github.event_name == 'pull_request_target' &&
(
github.event.pull_request.base.ref == 'main' ||
github.event.pull_request.base.ref == 'master' ||
contains(github.event.pull_request.base.ref, 'feat/')

)
)
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Thank you for creating your first issue! We appreciate your contribution and will review it soon. Please ensure you've provided all necessary details and followed the issue template."
pr-message: "Thank you for your first pull request! Before we review, please ensure your code follows our quality standards: run tests, check formatting, and verify linting. We'll review your changes as soon as possible."
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Thank you for creating your first issue! We appreciate your contribution and will review it soon. Please ensure you've provided all necessary details and followed the issue template."
pr-message: "Thank you for your first pull request! Before we review, please ensure your code follows our quality standards: run tests, check formatting, and verify linting. We'll review your changes as soon as possible."
1 change: 1 addition & 0 deletions api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ func main() {
log.Printf("Server starting on port %s", config.AppConfig.Port)
log.Fatal(http.ListenAndServe(":"+config.AppConfig.Port, nil))
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it to trigger suite

Loading