# This workflow will do a clean install of ferdi dev-dependencies, update the dependencies, build the source code and run tests. It will only run on scheduled trigger. name: Ferdi Dependency updates on: schedule: - cron: '0 0 * * *' # every night at 12 am env: USE_HARD_LINKS: false jobs: dependency_updates: runs-on: ubuntu-latest steps: - name: Set env vars run: | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV - name: Checkout code along with submodules uses: actions/checkout@v2 with: submodules: recursive fetch-depth: 0 - name: Cache node modules uses: actions/cache@v2 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: Use Node.js 14.16.1 uses: actions/setup-node@v2 with: node-version: 14.16.1 - name: Uninstall locally and reinstall node-gyp globally 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 run: npx lerna bootstrap - name: Update submodules, dependencies and run tests run: | echo "Updating submodules" git submodule update --remote -f echo "Updating browserslist db" npx browserslist@latest --update-db echo "Running linter and tests" npm run lint 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 $(git rev-parse --abbrev-ref HEAD) --no-verify