From 41c9e9b5b9c160aaaab5602786bc7d9939c41cc3 Mon Sep 17 00:00:00 2001 From: Matheus Marabesi Date: Sun, 22 Oct 2023 15:26:15 +0200 Subject: [PATCH] ci: split pipeline --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bca1163..982ec3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 + # - name: Setup kernel for react native, increase watchers # run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p @@ -38,7 +39,14 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} - cache: 'npm' + + - name: Attempt to restore the cache + uses: actions/cache@v3 + id: cache + with: + path: ./node_modules + key: ${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node # - name: install wine # run: | @@ -46,18 +54,36 @@ jobs: # sudo apt-get update # sudo apt-get install -f wine-stable wine32 - - name: export display - run: | - /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - echo ">>> Started xvfb" - - name: install + if: steps.cache.outputs.cache-hit != 'true' run: npm install --legacy-peer-deps - - name: test - run: npm run coveralls + test: + runs-on: ubuntu-latest + needs: [build] + steps: + - uses: actions/checkout@v3 + - name: Set Environment Variables + uses: tw3lveparsecs/github-actions-setvars@v0.1 + with: + envFilePath: ./envvars.for.actions + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Attempt to restore the cache + uses: actions/cache@v3 + id: cache_restore + with: + path: ./node_modules + key: ${{ runner.os }}-node + + - name: coverage env: DISPLAY: ':99.0' + run: npm run coveralls #- name: memory leak detection # run: npm run test -- --detectLeaks @@ -67,6 +93,11 @@ jobs: env: GH_TOKEN: ${{ secrets.GH_TOKEN }} + - name: export display + run: | + /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & + echo ">>> Started xvfb" + - name: Run cypress (acceptance tests) uses: cypress-io/github-action@v4 env: