Skip to content

Commit cb48c7a

Browse files
authored
Merge pull request #44 from BU-Spark/feat/ci-and-tests
feat(mobile): add Jest tests and CI pipeline
2 parents 3d768b1 + a82d1b6 commit cb48c7a

65 files changed

Lines changed: 8109 additions & 3793 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CI Workflows
2+
3+
This project uses **GitHub Actions** for continuous integration.
4+
5+
## Workflows Included
6+
7+
- **Mobile Lint**
8+
Runs ESLint in the `mobile/` app directory to enforce code quality and catch errors early.
9+
10+
- **Backend RBAC E2E**
11+
Runs Jest end-to-end tests in `backend/` to verify secure role-based access control.
12+
13+
## How They Run
14+
15+
| Workflow | Trigger |
16+
|---------|---------|
17+
| Mobile Lint | Push to `main` / `dev` + all pull requests |
18+
| Backend RBAC E2E | Push to `main` / `dev` or manual trigger |
19+
20+
## Challenges
21+
22+
- Ensuring proper working directories for monorepo structure (Fixed using `defaults.run.working-directory`)
23+
- Performance during installs (Fixed by caching Node dependency installs)
24+
25+
## In the Future
26+
27+
As we add more testing suites, we will expand our CI pipeline accordingly.
28+
29+
We plan to include full mobile end-to-end testing using [Detox](https://wix.github.io/Detox/) to ensure the entire app behaves correctly on real devices (soon!).
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Backend RBAC E2E
2+
3+
on:
4+
push:
5+
branches: [main, dev, feat/ci-and-tests]
6+
workflow_dispatch:
7+
8+
jobs:
9+
rbac-e2e:
10+
runs-on: ubuntu-latest
11+
12+
defaults:
13+
run:
14+
working-directory: backend
15+
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 24
24+
cache: npm
25+
cache-dependency-path: backend/package-lock.json
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run RBAC E2E Jest tests
31+
env:
32+
BASE: ${{ secrets.BASE }}
33+
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
34+
STUDENT_ID: ${{ secrets.STUDENT_ID }}
35+
ADMIN_ID: ${{ secrets.ADMIN_ID }}
36+
run: npm test

.github/workflows/mobile-lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Mobile Lint
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
12+
defaults:
13+
run:
14+
working-directory: mobile
15+
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 24
24+
cache: npm
25+
cache-dependency-path: mobile/package-lock.json
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Lint with ESLint (Expo)
31+
run: npm run lint

0 commit comments

Comments
 (0)