Repository navigation
GitHub Actions
Francois edited this page Dec 19, 2025
·
4 revisions
Presentation: GitHub Action is a continuous integration and continuous delivery platform to automate build, tests and deployment.
In the context of Transcendence project, it is especially helpful for:
- code quality: automation of linters, compilation and tests on pushed and PR to main
- portability: allows testing in a clean Ubuntu environment
Alternatives : Jenkins
Our project should define
-
Make rules
-
Scripts (in
package.jsonand to a certain extent separate files).
"build": "tsc",
"lint": "eslint .",
"test": "vitest",
"postinstall": "prisma generate",At the project root, in a .yml file
.github/
โโโ workflows/
โโโ ci.ymlCan execute in parallel a job on different configuration (ex: different Node versions or OS)
name: CI Pipeline
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
# Check out the repository code = clone it
- name: Checkout Code
uses: actions/checkout@v4
# Setup Node.js environment
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm' # Automatically caches node_modules
# Install Dependencies
# This will also trigger 'npx prisma generate' if defined in postinstall
# Using ci = clean install from the package-lock.json rather than i
- name: Install Dependencies
run: npm ci
# Linting
- name: Run Linter
run: npm run lint
# Build Project
- name: Build
run: npm run build
# Run Tests
# Ensure required env vars is set for tests (dummy value for schema validation)
- name: Run Tests
env:
UM_DB_URL: "file:./test.db"
run: npm testNo attempt yet
| โ Do | โ Don't |
|---|---|
| Cache dependencies | - |
| Use GitHub Secrets | Commit .env files |
| Always include npx prisma generate before building or testing | - |
| Separate jobs : split linting, building, testing | - |
| Pin action versions on a SHA | Not pin or pin on a tag such as @v1
|
Tip
To get a tag SHA gh api repos/actions/checkout/commits/v4 --jq .sha
| Type | Ressource | Notes |
|---|---|---|
| ๐ | Official Docs | - |
| ๐ | Starter workflow | - |
| ๐ฆ | Official CLI | - |
| ๐ฆ | ACT | Test workflows locally |
| ๐ก | Good intro | - |
| ๐ก | Sรฉcuritรฉ GHA | - |
Legend: ๐ Doc, ๐ Book, ๐ฅ Video, ๐ป GitHub, ๐ฆ Package, ๐ก Blog
- Gateway Service - API Gateway & JWT validation
- Auth Service - Authentication & 2FA/TOTP
- AI Service - AI opponent
- API Documentation - OpenAPI/Swagger
- DB Schema - Databases
- Fastify - Web framework
- Prisma - ORM
- WebSockets - Real-time communication
- Restful API - API standards
- React - UI library
- CSS - Styling
- Tailwind - CSS framework
- Accessibility - WCAG compliance
- TypeScript - Language
- Zod - Schema validation
- Nginx - Reverse proxy
- Logging and Error management - Observability
- OAuth 2.0 - Authentication flows
- Two-factor authentication - 2FA/TOTP
- Avalanche - Blockchain network
- Hardhat - Development framework
- Solidity - Smart contracts language
- Open Zeppelin - Security standards
- ESLint - Linting
- Vitest - Testing
- GitHub Actions - CI/CD
- Husky, Commit lints and git hooks - Git hooks
- ELK - Logging stack
๐ Page model