feat: add configurable cookie security and login rate limiting #31
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 ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| frontend-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run unit tests | |
| run: npm run test:coverage | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Run E2E tests | |
| run: npm run test:e2e | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| backend-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: 1.82.0 | |
| override: true | |
| components: rustfmt, clippy | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo build | |
| uses: actions/cache@v4 | |
| with: | |
| path: backend/target | |
| key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Run rustfmt | |
| working-directory: ./backend | |
| run: cargo fmt -- --check | |
| - name: Run clippy | |
| working-directory: ./backend | |
| run: cargo clippy -- -D warnings | |
| - name: Run tests | |
| working-directory: ./backend | |
| run: cargo test | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [frontend-test, backend-test] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: 1.82.0 | |
| override: true | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Build frontend | |
| run: npm run build | |
| - name: Build backend | |
| working-directory: ./backend | |
| run: cargo build --release | |
| - name: Upload frontend artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: dist/ | |
| - name: Upload backend artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend-binary | |
| path: backend/target/release/linux-tutorial-backend |