Skip to content
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
60 changes: 55 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@ jobs:
working-directory: contracts
run: make build

- name: Run contract tests
- name: Run contract tests with coverage
working-directory: contracts
run: make test
run: |
cargo install cargo-tarpaulin
make test-coverage

- name: Upload Contract Coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: contracts/tarpaulin-report.xml
flags: contracts
token: ${{ secrets.CODECOV_TOKEN }}

- name: Install cargo-audit
run: cargo install cargo-audit
Expand Down Expand Up @@ -68,9 +77,44 @@ jobs:
working-directory: backend
run: npm ci

- name: Run tests
- name: Run tests with coverage
working-directory: backend
run: npm test
run: npm run test:coverage

- name: Upload Backend Coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: backend/coverage/lcov.info
flags: backend
token: ${{ secrets.CODECOV_TOKEN }}

frontend:
name: Node.js frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
working-directory: frontend
run: npm install --legacy-peer-deps

- name: Run tests with coverage
working-directory: frontend
run: npm run test:coverage

- name: Upload Frontend Coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: frontend/coverage/lcov.info
flags: frontend
token: ${{ secrets.CODECOV_TOKEN }}

- name: Dependency audit
working-directory: backend
Expand Down Expand Up @@ -128,10 +172,16 @@ jobs:
working-directory: python-service
run: pip install -r requirements.txt

- name: Run tests
- name: Run tests with coverage
working-directory: python-service
run: pytest

- name: Upload Python Coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: python-service/coverage.xml
flags: python
token: ${{ secrets.CODECOV_TOKEN }}
- name: Install pip-audit
run: pip install pip-audit

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Vacci-Chain

[![CI](https://github.com/EDOHWARES/VacciChain/actions/workflows/ci.yml/badge.svg)](https://github.com/EDOHWARES/VacciChain/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/EDOHWARES/VacciChain/graph/badge.svg?token=YOUR_TOKEN)](https://codecov.io/gh/EDOHWARES/VacciChain)

> Blockchain-based vaccination records on Stellar — soulbound, verifiable, tamper-proof.

Expand Down
1 change: 1 addition & 0 deletions backend/coverage/tmp/coverage-1144-1777464226211-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/coverage/tmp/coverage-11868-1777464235282-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/coverage/tmp/coverage-13804-1777464235265-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/coverage/tmp/coverage-14420-1777464227209-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/coverage/tmp/coverage-15860-1777464235495-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/coverage/tmp/coverage-16724-1777464235272-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/coverage/tmp/coverage-3352-1777464227219-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/coverage/tmp/coverage-4396-1777464227202-0.json

Large diffs are not rendered by default.

233 changes: 233 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"start": "node src/app.js",
"dev": "nodemon src/app.js",
"test": "jest --forceExit",
"test:coverage": "c8 --check-coverage --lines 70 --functions 70 --branches 70 jest --forceExit",
"seed": "node scripts/seed_demo.mjs"
"seed": "node scripts/seed_demo.mjs",
"load-test": "k6 run load-test.js",
"load-test:baseline": "k6 run -e BASE_URL=http://localhost:4000 -e VUS=100 -e DURATION=60s load-test.js"
Expand Down Expand Up @@ -34,6 +36,7 @@
}
},
"devDependencies": {
"c8": "^11.0.0",
"@faker-js/faker": "^8.4.1",
"jest": "^29.7.0",
"nodemon": "^3.0.2",
Expand Down
13 changes: 12 additions & 1 deletion backend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@ const requestId = require('./middleware/requestId');
const { sanitizeInputs } = require('./middleware/sanitize');

const app = express();

const allowedOrigins = (process.env.ALLOWED_ORIGINS || '').split(',').map(o => o.trim()).filter(Boolean);

app.use(cors({
origin: (origin, callback) => {
if (!origin || allowedOrigins.includes(origin)) {
callback(null, true);
} else {
callback(null, false);
}
},
credentials: true
}));
app.use(securityHeaders);
app.use(cors());
app.use(express.json({ limit: config.BODY_LIMIT }));
Expand Down
Loading
Loading