Merge pull request #61 from MIHIR2006/db/migrate-postgres #10
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: Monorepo Production Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| jobs: | |
| setup-install: | |
| name: Install all dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Use Node.js 18 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| cache: "npm" | |
| - name: Install root and frontend dependencies | |
| run: npm install --workspaces | |
| - name: Setup Python 3.9 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.9 | |
| - name: Install backend Python dependencies | |
| working-directory: ./backend | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| frontend-build-start: | |
| name: Build and start frontend for production test | |
| runs-on: ubuntu-latest | |
| needs: setup-install | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Use Node.js 18 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| cache: "npm" | |
| - name: Install dependencies (frontend) | |
| working-directory: ./frontend | |
| run: npm install | |
| - name: Build frontend production | |
| working-directory: ./frontend | |
| run: npm run build | |
| - name: Start frontend app and test | |
| working-directory: ./frontend | |
| run: | | |
| npm run start & # start frontend in background | |
| sleep 10 # wait for app to initialize | |
| kill $! # stop the app | |
| # backend-test-lint: | |
| # name: Run backend lint and tests | |
| # runs-on: ubuntu-latest | |
| # needs: setup-install | |
| # steps: | |
| # - name: Checkout repository | |
| # uses: actions/checkout@v3 | |
| # - name: Setup Python 3.9 | |
| # uses: actions/setup-python@v4 | |
| # with: | |
| # python-version: 3.9 | |
| # - name: Install backend dependencies | |
| # working-directory: ./backend | |
| # run: | | |
| # python -m pip install --upgrade pip | |
| # pip install -r requirements.txt | |
| # - name: Run backend lint checks | |
| # working-directory: ./backend | |
| # run: | | |
| # black . --check | |
| # isort . --check-only | |
| # flake8 . | |
| # - name: Run backend tests | |
| # working-directory: ./backend | |
| # run: pytest |