|
1 | | -name: CI Pipeline |
| 1 | +name: Simple CI |
2 | 2 |
|
3 | | -# When to run this workflow |
| 3 | +# Only run on main branch pushes for a solo project |
4 | 4 | on: |
5 | | - push: |
6 | | - branches: [main, develop] |
7 | | - pull_request: |
8 | | - branches: [main] |
| 5 | + push: |
| 6 | + branches: [main] |
9 | 7 |
|
10 | 8 | jobs: |
11 | | - # Test the backend |
12 | | - test-backend: |
13 | | - runs-on: ubuntu-latest |
14 | | - |
15 | | - steps: |
16 | | - # Step 1: Get the code from GitHub |
17 | | - - name: Checkout code |
18 | | - uses: actions/checkout@v4 |
19 | | - |
20 | | - # Step 2: Install Node.js |
21 | | - - name: Setup Node.js |
22 | | - uses: actions/setup-node@v4 |
23 | | - with: |
24 | | - node-version: "18" |
25 | | - cache: "npm" |
26 | | - cache-dependency-path: backend/package-lock.json |
27 | | - |
28 | | - # Step 3: Install dependencies |
29 | | - - name: Install backend dependencies |
30 | | - run: | |
31 | | - cd backend |
32 | | - npm ci |
33 | | -
|
34 | | - # Step 4: Run tests (THIS IS THE IMPORTANT PART) |
35 | | - - name: Run backend tests |
36 | | - run: | |
37 | | - cd backend |
38 | | - npm test |
39 | | -
|
40 | | - # Build and test frontend |
41 | | - test-frontend: |
42 | | - runs-on: ubuntu-latest |
43 | | - |
44 | | - steps: |
45 | | - - name: Checkout code |
46 | | - uses: actions/checkout@v4 |
47 | | - |
48 | | - - name: Setup Node.js |
49 | | - uses: actions/setup-node@v4 |
50 | | - with: |
51 | | - node-version: "18" |
52 | | - cache: "npm" |
53 | | - cache-dependency-path: frontend/package-lock.json |
54 | | - |
55 | | - - name: Install frontend dependencies |
56 | | - run: | |
57 | | - cd frontend |
58 | | - npm ci |
59 | | -
|
60 | | - # Check for code style issues |
61 | | - - name: Lint frontend code |
62 | | - run: | |
63 | | - cd frontend |
64 | | - npm run lint |
65 | | -
|
66 | | - # Make sure frontend builds without errors |
67 | | - - name: Build frontend |
68 | | - run: | |
69 | | - cd frontend |
70 | | - npm run build |
71 | | -
|
72 | | - # Optional: Test Docker builds (comment out if you don't want this yet) |
73 | | - docker-build: |
74 | | - runs-on: ubuntu-latest |
75 | | - needs: [test-backend, test-frontend] |
76 | | - |
77 | | - steps: |
78 | | - - name: Checkout code |
79 | | - uses: actions/checkout@v4 |
80 | | - |
81 | | - - name: Test Docker build |
82 | | - run: | |
83 | | - docker-compose build |
84 | | - echo "Docker images built successfully" |
| 9 | + # Quick check that everything still works |
| 10 | + quick-check: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout code |
| 15 | + uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Setup Node.js |
| 18 | + uses: actions/setup-node@v4 |
| 19 | + with: |
| 20 | + node-version: "18" |
| 21 | + |
| 22 | + # Build and test backend |
| 23 | + - name: Build and test backend |
| 24 | + run: | |
| 25 | + cd backend |
| 26 | + npm install |
| 27 | + npm test |
| 28 | + echo "Backend tests passed ✓" |
| 29 | +
|
| 30 | + # Build frontend |
| 31 | + - name: Build frontend |
| 32 | + run: | |
| 33 | + cd frontend |
| 34 | + npm install |
| 35 | + npm run build |
| 36 | + echo "Frontend built successfully ✓" |
0 commit comments