-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
430 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,53 @@ | ||
name: CI Pipeline | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
scan-code: | ||
name: Scan Code | ||
continuous_integration: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Snyk Scan | ||
uses: snyk/actions/npm@v2 | ||
with: | ||
args: test | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
needs: scan-code | ||
steps: | ||
- name: Checkout code | ||
- name: Checkout code 🛎️ | ||
uses: actions/checkout@v3 | ||
with: | ||
clean: true | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Run Jest Tests | ||
run: npm test | ||
|
||
- name: Run Storybook Visual Tests | ||
run: npm run storybook:test | ||
|
||
code-sandbox: | ||
name: CodeSandbox CI | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set Node Version | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.13.1 | ||
|
||
- name: Create CodeSandbox Environment | ||
- name: Setup .npmrc file | ||
run: | | ||
npx codesandbox-cli create | ||
echo "@3um-group:registry=https://npm.pkg.github.com/" > ~/.npmrc | ||
echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc | ||
integration-tests: | ||
name: Run Integration and E2E Tests | ||
runs-on: ubuntu-latest | ||
needs: code-sandbox | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Integration Tests | ||
run: npm run integration-tests | ||
|
||
- name: Run E2E Tests | ||
run: npm run e2e-tests | ||
|
||
codacy: | ||
name: Update Code Quality Findings | ||
runs-on: ubuntu-latest | ||
needs: integration-tests | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Packages | ||
run: npm install | ||
|
||
- name: Codacy Analysis | ||
uses: codacy/codacy-analysis-cli-action@v4 | ||
with: | ||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
- name: Run Test | ||
run: npm run test | ||
- name: Deploy to CodeSandbox | ||
env: | ||
CODESANDBOX_API_TOKEN: ${{ secrets.CODESANDBOX_API_TOKEN }} | ||
run: | | ||
# Install CodeSandbox CLI if not already installed | ||
npm install -g codesandbox | ||
pr-label-checker: | ||
name: PR Label Checker | ||
runs-on: ubuntu-latest | ||
needs: codacy | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
# Log in to CodeSandbox | ||
codesandbox login --token $CODESANDBOX_API_TOKEN | ||
- name: PR Label Checker | ||
uses: pr-label-checker-action@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
update-project-column: | ||
name: Update Quarterly GitHub Project Column | ||
runs-on: ubuntu-latest | ||
needs: pr-label-checker | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
# Create or update sandbox (replace with appropriate command or API call) | ||
codesandbox create --name "Fortuna" --directory . | ||
- name: Update Project Column | ||
uses: github-actions-automate-projects@v1 | ||
with: | ||
project-column: 'Quarterly' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
# Optional: Publish or serve the sandbox (replace with appropriate command or API call) | ||
codesandbox publish --sandbox "Fortuna" --port 3000 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export default { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'], // Use TypeScript setup if needed | ||
moduleNameMapper: { | ||
'^@/(.*)$': '<rootDir>/src/$1', // Alias for easy imports from src | ||
}, | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest', // Transpile TypeScript files | ||
}, | ||
testRegex: '(/test/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$', // Custom regex to find test files in the /test/ folder | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], // Supported file extensions | ||
collectCoverage: true, | ||
collectCoverageFrom: [ | ||
'src/**/*.{ts,tsx}', | ||
'!src/index.tsx', // Exclude index.tsx from coverage | ||
'!src/**/*.d.ts', | ||
], | ||
coverageDirectory: 'coverage', // Directory for coverage reports | ||
testPathIgnorePatterns: ['/node_modules/', '/test/test-utils.tsx'], | ||
|
||
}; | ||
|
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { BalanceCardProps } from '../../types/BalanceCardTypes'; | ||
|
||
const BalanceCard: React.FC<BalanceCardProps> = ({ title, amount }) => { | ||
return ( | ||
<div className="bg-white p-4 rounded-lg shadow-md flex flex-col items-center"> | ||
<span className="text-xs font-bold">{title}</span> | ||
<span className="text-lg font-light">{amount}</span> | ||
</div> | ||
); | ||
}; | ||
export default BalanceCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { FaHome, FaWallet, FaUser } from 'react-icons/fa'; | ||
|
||
const DrawerMenu: React.FC = () => { | ||
return ( | ||
<div className="bg-white h-20 w-full flex items-center justify-evenly rounded-t-3xl shadow-lg fixed bottom-0"> | ||
<span className="text-yellow-400 text-2xl cursor-pointer"> | ||
<FaHome data-testid="home-icon" /> | ||
</span> | ||
<span className="text-yellow-400 text-2xl cursor-pointer"> | ||
<FaWallet data-testid="wallet-icon" /> | ||
</span> | ||
<span className="text-yellow-400 text-2xl cursor-pointer"> | ||
<FaUser data-testid="user-icon" /> | ||
</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DrawerMenu; |
Oops, something went wrong.