Skip to content

Commit 21d3d05

Browse files
authored
Merge pull request #2 from josbell/dev
Configure e2e for ci/cd
2 parents 5461608 + 77b9d68 commit 21d3d05

File tree

5 files changed

+8056
-69
lines changed

5 files changed

+8056
-69
lines changed

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
steps:
1919
# Checkout the repository
2020
- name: Checkout repository
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222

2323
# Setup Node.js
2424
- name: Setup Node.js
25-
uses: actions/setup-node@v3
25+
uses: actions/setup-node@v4
2626
with:
2727
node-version: 23
2828

.github/workflows/cypress-e2e.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Cypress E2E Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
e2e-tests:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout Frontend Repo
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 23
23+
cache: "npm"
24+
25+
- name: Install Frontend Dependencies
26+
run: npm install
27+
28+
- name: Checkout API Repo
29+
uses: actions/checkout@v4
30+
with:
31+
repository: marcomolina11/todos-mongo-api
32+
path: backend
33+
34+
- name: List Files in Backend Directory
35+
run: ls -la backend
36+
37+
- name: Start Backend with Docker Compose
38+
working-directory: backend
39+
run: docker compose up -d
40+
41+
- name: Wait for Backend to be Ready
42+
run: npx wait-on tcp:127.0.0.1:3000
43+
44+
- name: Start Frontend
45+
run: |
46+
nohup npm run start -- --host &
47+
48+
- name: Wait for Frontend to be Ready
49+
run: npx wait-on http://localhost:5173
50+
51+
- name: Run Cypress Tests
52+
run: npm run test:e2e:cicd
53+
env:
54+
API_URL: http://localhost:3000
55+
56+
- name: Stop Containers
57+
if: always()
58+
run: |
59+
cd backend
60+
docker compose down

.gitignore

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
logs
33
*.log
44
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
75

86
# Runtime data
97
pids
@@ -39,47 +37,10 @@ public/favicon.ico # Example - ignore if customized and part of the repo
3937
.env.local
4038
.env.*.local
4139

42-
# Next.js build output
43-
.next/
44-
45-
# Nuxt.js build output
46-
.nuxt/
47-
48-
# Gatsby files
49-
.cache/
50-
public/
51-
52-
# Gridsome files
53-
.cache/
54-
55-
# Vuepress build output
56-
.vuepress/dist
57-
58-
# Serverless Framework files
59-
.serverless/
60-
61-
# FuseBox cache
62-
.fusebox/
63-
64-
# DynamoDB Local files
65-
.dynamodb/
66-
67-
# TernJS port file
68-
.tern-port
69-
7040
# VS Code specific files
7141
.vscode/
7242
*.code-workspace
7343

74-
# SASS cache
75-
.sass-cache/
76-
77-
# Nuxt.js generated files
78-
dist/
79-
80-
# Storybook files
81-
.storybook-out/
82-
8344
# MacOS system files
8445
.DS_Store
8546

@@ -100,19 +61,6 @@ dist/
10061
.idea/
10162
*.iml
10263

103-
# Yarn
104-
.yarn/*
105-
!.yarn/patches
106-
!.yarn/plugins
107-
!.yarn/releases
108-
!.yarn/sdks
109-
!.yarn/versions
110-
111-
# Lockfiles
112-
package-lock.json
113-
yarn.lock
114-
.pnpm-debug.log
115-
11664
# ESLint and Prettier
11765
.eslintcache
11866
.prettierignore
@@ -123,22 +71,9 @@ yarn.lock
12371
*.lcov
12472
.nyc_output/
12573

126-
# Parcel-bundler cache
127-
.cache, .parcel-cache
128-
12974
# TypeScript
13075
*.tsbuildinfo
13176

132-
# React Native
133-
*.expo
134-
.expo-shared
135-
136-
# Firebase local cache
137-
.firebase/
138-
139-
# AWS SAM
140-
.aws-sam/
141-
14277
# JetBrains
14378
.idea/
14479

0 commit comments

Comments
 (0)