feat: Add JWT authentication and authorization module, and comment AP… #220
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@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| - name: Clean install dependencies | |
| run: | | |
| rm -rf node_modules package-lock.json | |
| npm install | |
| - 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@v5 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| backend-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: 1.83.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@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: 1.83.0 | |
| override: true | |
| - name: Clean install frontend dependencies | |
| run: | | |
| rm -rf node_modules package-lock.json | |
| npm install | |
| - 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@v5 | |
| with: | |
| name: frontend-dist | |
| path: dist/ | |
| - name: Upload backend artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: backend-binary | |
| path: backend/target/release/linux-tutorial-backend |