From 16b354740cc832a473c16e1e81d97a07efc8dee7 Mon Sep 17 00:00:00 2001 From: Riccardo Senica Date: Sat, 11 Oct 2025 15:13:31 +0200 Subject: [PATCH] ci: add pipeline --- .github/workflows/ci.yml | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a27f5ff --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,89 @@ +name: CI + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +jobs: + lint-and-typecheck: + name: Lint & Type Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run ESLint + run: yarn lint + + - name: Run TypeScript type check + run: yarn typecheck + + - name: Run Prettier check + run: yarn format + + build-and-test: + name: Build & Test + runs-on: ubuntu-latest + needs: lint-and-typecheck + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Build application + run: yarn build + + - name: Run tests + run: yarn test --coverage --watchAll=false + + - name: Report deployment readiness + if: github.ref == 'refs/heads/main' + run: echo "✅ All checks passed - ready for deployment" + + commitlint: + name: Commit Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Validate commit messages + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + yarn commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose + else + yarn commitlint --from HEAD~1 --to HEAD --verbose + fi \ No newline at end of file