WIP: Refactor documentation and docker configs #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop, refactorv4] | |
| pull_request: | |
| branches: [main, develop, refactorv4] | |
| jobs: | |
| license-check: | |
| runs-on: ubuntu-latest | |
| env: | |
| HUSKY: 0 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: HUSKY=0 pnpm run ci:install | |
| - name: Check license headers | |
| run: pnpm run check-licenses | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| HUSKY: 0 | |
| needs: license-check | |
| strategy: | |
| matrix: | |
| node-version: [22.x] | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: test | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: HUSKY=0 pnpm run ci:install | |
| - name: Run linting | |
| run: pnpm run lint | |
| - name: Run type checking | |
| run: pnpm run type-check | |
| - name: Validate OpenAPI specification | |
| working-directory: packages/backend | |
| run: pnpm run validate-api | |
| - name: Run tests | |
| env: | |
| POSTGRES: postgresql://test:test@localhost:5432/test | |
| POSTGRES_TEST: postgresql://test:test@localhost:5432/test | |
| JWT_SECRET: test_secret | |
| ADMIN_EMAIL: admin@example.com | |
| ADMIN_PASSWORD: test_password | |
| run: pnpm test | |
| - name: Build projects | |
| run: pnpm run build | |
| security: | |
| runs-on: ubuntu-latest | |
| env: | |
| HUSKY: 0 | |
| needs: license-check | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: HUSKY=0 pnpm run ci:install | |
| - name: Run security audit | |
| continue-on-error: true | |
| run: pnpm audit --prod |