Skip to content
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

Refactor #15

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
45 changes: 45 additions & 0 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI - Testing code before merging to main
on:
pull_request:
branches: [main]

jobs:
sonarcloud:
runs-on: ubuntu-latest
env:
APP_PORT: ${{ secrets.APP_PORT }}
APP_CORS_ALLOWED_ORIGINS: ${{ secrets.APP_CORS_ALLOWED_ORIGINS }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
TWITCH_CLIENT_ID: ${{ secrets.TWITCH_CLIENT_ID }}
TWITCH_SECRET_ID: ${{ secrets.TWITCH_SECRET_ID }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_SCHEMA: ${{ secrets.DB_SCHEMA }}
DB_URL: postgresql://${{ secrets.DB_USER}}:${{secrets.DB_PASSWORD}}@${{secrets.DB_HOST}}:${{secrets.DB_PORT}}/${{secrets.DB_NAME}}?schema=${{secrets.DB_SCHEMA}}

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Dependencies
run: npm install

- name: Run Tests with coverage
run: npm test

- name: Testing the Docker image building and container startup
run: |
docker-compose -f docker-compose.actions.yml up -d

- name: Clean Up and Stop Docker Containers
run: |
docker-compose -f docker-compose.actions.yml down
docker system prune -f
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Build Docker-Compose Backend App
name: CI/CD - Build Docker-Compose app and deploy it to EC2

on:
push:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,5 @@ temp

build/
docker-app-data-pc-host

.vscode
4 changes: 3 additions & 1 deletion src/app/services/external/igdbService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ async function getMostPopularGamesOfLastDecade(accessToken: string) {
}

async function getGameInformation(accessToken: string, slug: string) {
const queryFilter = `fields name, rating, slug, summary, cover.id, cover.game, cover.height, cover.url, cover.width;
const queryFilter = `fields name, rating, slug, summary, first_release_date,
platforms.name, platforms.platform_logo.url,
cover.id, cover.game, cover.height, cover.url, cover.width;
where slug = "${slug}";`;

const response = await axios.post(igdbPath, queryFilter, {
Expand Down