diff options
Diffstat (limited to '.github/workflows/dependency-updates.yml')
-rw-r--r-- | .github/workflows/dependency-updates.yml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml new file mode 100644 index 000000000..61e22c03a --- /dev/null +++ b/.github/workflows/dependency-updates.yml | |||
@@ -0,0 +1,63 @@ | |||
1 | # 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. | ||
2 | |||
3 | name: Ferdi Dependency updates | ||
4 | |||
5 | on: | ||
6 | schedule: | ||
7 | - cron: '0 0 * * *' # every night at 12 am | ||
8 | |||
9 | env: | ||
10 | USE_HARD_LINKS: false | ||
11 | |||
12 | jobs: | ||
13 | dependency_updates: | ||
14 | runs-on: ubuntu-latest | ||
15 | steps: | ||
16 | - name: Set env vars | ||
17 | run: | | ||
18 | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV | ||
19 | - name: Checkout code along with submodules | ||
20 | uses: actions/checkout@v2 | ||
21 | with: | ||
22 | submodules: recursive | ||
23 | fetch-depth: 0 | ||
24 | - name: Cache node modules | ||
25 | uses: actions/cache@v2 | ||
26 | env: | ||
27 | cache-name: cache-node-modules | ||
28 | with: | ||
29 | path: ${{ env.NPM_CACHE }} | ||
30 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
31 | restore-keys: | | ||
32 | ${{ runner.os }}-build-${{ env.cache-name }}- | ||
33 | ${{ runner.os }}-build- | ||
34 | ${{ runner.os }}- | ||
35 | - name: Use Node.js 14.16.1 | ||
36 | uses: actions/setup-node@v2 | ||
37 | with: | ||
38 | node-version: 14.16.1 | ||
39 | - name: Uninstall locally and reinstall node-gyp globally | ||
40 | run: | | ||
41 | npm uninstall node-gyp | ||
42 | npm i -g node-gyp@8.0.0 && npm config set node_gyp "$(which node-gyp)" | ||
43 | - name: Install node dependencies recursively | ||
44 | run: npx lerna bootstrap | ||
45 | - name: Setup git configs | ||
46 | run: | | ||
47 | git config user.name github-actions | ||
48 | git config user.email github-actions@github.com | ||
49 | - name: Update submodules, dependencies and run tests | ||
50 | run: | | ||
51 | echo "Updating submodules" | ||
52 | git submodule update --remote -f | ||
53 | |||
54 | echo "Updating browserslist db" | ||
55 | npx browserslist@latest --update-db | ||
56 | |||
57 | echo "Running linter and tests" | ||
58 | npm run lint | ||
59 | npm run test | ||
60 | |||
61 | echo "Committing and pushing submodules, dependency-updates and linter changes" | ||
62 | git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify || true | ||
63 | git push origin nightly --no-verify | ||