Dev #201
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: | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| env: | |
| REACT_APP_FIREBASE_APIKEY: ${{ secrets.FIREBASE_APIKEY }} | |
| REACT_APP_FIREBASE_AUTHDOMAIN: ${{ secrets.FIREBASE_AUTHDOMAIN }} | |
| REACT_APP_FIREBASE_PROJECTID: ${{ secrets.FIREBASE_PROJECTID }} | |
| REACT_APP_FIREBASE_STORAGEBUCKET: ${{ secrets.FIREBASE_STORAGEBUCKET }} | |
| REACT_APP_FIREBASE_MESSAGINGSENDERID: ${{ secrets.FIREBASE_MESSAGINGSENDERID }} | |
| REACT_APP_FIREBASE_APPID: ${{ secrets.FIREBASE_APPID }} | |
| REACT_APP_FIREBASE_MEASUREMENTID: ${{ secrets.FIREBASE_MEASUREMENTID }} | |
| strategy: | |
| matrix: | |
| node-version: [18.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| # --------------------------- | |
| # FRONTEND | |
| # --------------------------- | |
| - name: Install frontend dependencies | |
| env: | |
| CI: false | |
| run: | | |
| while true; do echo "Still getting dependencies..."; sleep 60; done & | |
| npm install | |
| npm ci | |
| kill %1 | |
| working-directory: nutri.me | |
| - name: Build frontend | |
| env: | |
| CI: false | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| run: | | |
| while true; do echo "Still building..."; sleep 60; done & | |
| npm run build | |
| kill %1 | |
| working-directory: nutri.me | |
| - name: Run frontend tests | |
| run: CI=false npm test -- --verbose | |
| working-directory: nutri.me |