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

Setup ci test stages #35

Merged
merged 15 commits into from
Feb 27, 2024
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
37 changes: 35 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CI
run-name: ${{ github.actor }} is running ${{ github.workflow }} on commit ${{ github.sha }}
run-name: ${{ github.actor }} is running ${{ github.workflow }} on commit ${{ github.sha }} for branch ${{ github.ref }}

on:
push:
Expand All @@ -18,6 +18,7 @@ env:
jobs:

build:
name: Build and push Docker image
runs-on: ubuntu-latest
concurrency:
group: build-${{ github.sha }}
Expand All @@ -43,6 +44,7 @@ jobs:
cache-to: type=inline

lint:
name: Lint code - Code style check
runs-on: ubuntu-latest
needs: build
concurrency:
Expand All @@ -66,6 +68,7 @@ jobs:
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/utils lint

tests-unit-backend:
name: Run unit tests on workspace backend
runs-on: ubuntu-latest
needs: build
concurrency:
Expand All @@ -74,4 +77,34 @@ jobs:
steps:
- name: Run unit tests on workspace backend
id: backend
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/backend test:unit
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/backend test:unit

tests-unit-frontend:
name: Run unit tests on workspace frontend
runs-on: ubuntu-latest
needs: build
concurrency:
group: tests-unit-frontend-${{ github.sha }}
cancel-in-progress: true
steps:
- name: Run unit tests on workspace frontend
id: frontend
run: docker run ${{ env.DOCKER_TAG }} yarn workspace @team8/frontend test:unit

tests-backend-e2e:
name: Run integration tests on workspace backend
runs-on: ubuntu-latest
needs: build
continue-on-error: true
concurrency:
group: tests-backend-e2e-${{ github.sha }}
cancel-in-progress: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Run e2e tests on workspace backend
id: backend
run: docker-compose run apps-dev yarn workspace @team8/backend test:e2e
continue-on-error: true
14 changes: 0 additions & 14 deletions apps/frontend/test/unit/Cards.spec.tsx

This file was deleted.

13 changes: 13 additions & 0 deletions apps/frontend/test/unit/dummy.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { render } from '@testing-library/react';
import React from 'react';

describe('Cards', () => {
test('should render component', () => {
render(<p>Hello world</p>)
});

test('should contain Hello World', () => {
const { getByText } = render(<p>Hello world</p>);
expect(getByText('Hello world')).toBeTruthy();
});
});
Loading