Update azure-container-webapp.yml #8
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 Pipeline | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| pull_request: | |
| branches: [ main, dev ] | |
| jobs: | |
| lint-and-test-frontend: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: './frontend/package.json' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Lint | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm test | |
| lint-and-test-backend: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 pytest | |
| pip install -r requirements.txt | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # Optional: Add backend tests when available | |
| # - name: Test with pytest | |
| # run: | | |
| # pytest | |
| build-docker-images: | |
| runs-on: ubuntu-latest | |
| needs: [lint-and-test-frontend, lint-and-test-backend] | |
| if: github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build and test backend Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./backend | |
| push: false | |
| load: true | |
| tags: migration-pathways-backend:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build and test frontend Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./frontend | |
| push: false | |
| load: true | |
| tags: migration-pathways-frontend:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |