From bdc074ec2f20d5385f34ae9b1bc467180639f850 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Wed, 30 Jun 2021 08:43:35 +0530 Subject: Simplified the scheduled nightly build since the linter and tests are anyways run on the different OS-based jobs. --- .github/workflows/dependency-updates.yml | 6 +-- .github/workflows/ferdi-builds.yml | 67 +++----------------------------- 2 files changed, 7 insertions(+), 66 deletions(-) (limited to '.github') diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml index 61e22c03a..bffcb54a3 100644 --- a/.github/workflows/dependency-updates.yml +++ b/.github/workflows/dependency-updates.yml @@ -42,10 +42,6 @@ jobs: npm i -g node-gyp@8.0.0 && npm config set node_gyp "$(which node-gyp)" - name: Install node dependencies recursively run: npx lerna bootstrap - - name: Setup git configs - run: | - git config user.name github-actions - git config user.email github-actions@github.com - name: Update submodules, dependencies and run tests run: | echo "Updating submodules" @@ -59,5 +55,7 @@ jobs: npm run test echo "Committing and pushing submodules, dependency-updates and linter changes" + git config user.name github-actions + git config user.email github-actions@github.com git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify || true git push origin nightly --no-verify diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml index e93e8b8f9..399b3c7ea 100644 --- a/.github/workflows/ferdi-builds.yml +++ b/.github/workflows/ferdi-builds.yml @@ -37,12 +37,6 @@ jobs: outputs: should_run: ${{ steps.should_run.outputs.should_run }} steps: - - name: Set env vars - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - run: | - echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV - echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV - echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' uses: actions/checkout@v2 if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} @@ -50,66 +44,15 @@ jobs: ref: nightly submodules: recursive fetch-depth: 0 - - name: Cache node modules - uses: actions/cache@v2 - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - env: - cache-name: cache-node-modules - with: - path: ${{ env.NPM_CACHE }} - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - name: Cache electron modules - uses: actions/cache@v2 - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - env: - cache-name: cache-electron-modules - with: - key: ${{ runner.os }}-${{ env.cache-name }} - path: ${{ env.ELECTRON_CACHE }} - - name: Cache electron-builder modules - uses: actions/cache@v2 - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - env: - cache-name: cache-electron-builder-modules - with: - key: ${{ runner.os }}-${{ env.cache-name }} - path: ${{ env.ELECTRON_BUILDER_CACHE }} - - name: Use Node.js 14.16.1 - uses: actions/setup-node@v2 - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - with: - node-version: 14.16.1 - - name: Uninstall locally and reinstall node-gyp globally - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - run: | - npm uninstall node-gyp - npm i -g node-gyp@8.0.0 && npm config set node_gyp "$(which node-gyp)" - - name: Install node dependencies recursively - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - run: npx lerna bootstrap - - name: Print latest commit - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - run: echo ${{ github.sha }} - - name: Setup git configs + - id: should_run + name: Check whether there are any commits since this run was last triggered and push them and/or set the output if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} run: | git config user.name github-actions git config user.email github-actions@github.com - - name: Merge from 'origin/develop' (continue if errored) - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - continue-on-error: true - run: git merge --no-ff --no-verify --commit -m "Merge remote-tracking branch 'origin/develop' into HEAD" origin/develop - - id: should_run - name: Check whether there are any commits since this run was last triggered and either push or set the output - if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} - run: | - echo "Running linter and tests" - npm run lint && npm run test - git commit -am "Apply linter fixes" --no-verify || true + + echo "Merge from 'origin/develop'" + git merge --no-ff --no-verify --commit -m "Merge remote-tracking branch 'origin/develop' into HEAD" origin/develop CHANGES_COUNT=$(git diff --shortstat origin/nightly | wc -l) MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" -- cgit v1.2.3-54-g00ecf