diff options
author | Vijay A <avijayr@protonmail.com> | 2021-06-30 08:20:01 +0530 |
---|---|---|
committer | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-06-30 15:15:34 +0530 |
commit | c0a0aa8105251cebc35ab807e6d701806f5b301d (patch) | |
tree | 0c863dcce890fc052e9ab67fd81256f59024f33a /.github/workflows | |
parent | Added a TODO for new announcements related to updates. (diff) | |
download | ferdium-app-c0a0aa8105251cebc35ab807e6d701806f5b301d.tar.gz ferdium-app-c0a0aa8105251cebc35ab807e6d701806f5b301d.tar.zst ferdium-app-c0a0aa8105251cebc35ab807e6d701806f5b301d.zip |
Split up the dependency updates into its own scheduled job and to be run on the 'develop' branch instead of 'nightly' branch
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/dependency-updates.yml | 63 | ||||
-rw-r--r-- | .github/workflows/ferdi-builds.yml | 17 |
2 files changed, 66 insertions, 14 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 | ||
diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml index 35182c222..e93e8b8f9 100644 --- a/.github/workflows/ferdi-builds.yml +++ b/.github/workflows/ferdi-builds.yml | |||
@@ -24,7 +24,7 @@ on: | |||
24 | description: 'Message for build' | 24 | description: 'Message for build' |
25 | required: true | 25 | required: true |
26 | schedule: | 26 | schedule: |
27 | - cron: '0 0 * * *' # every night at 12 am | 27 | - cron: '0 1 * * *' # every night at 1 am (to allow for dependency builds to complete) |
28 | 28 | ||
29 | env: | 29 | env: |
30 | USE_HARD_LINKS: false | 30 | USE_HARD_LINKS: false |
@@ -103,25 +103,14 @@ jobs: | |||
103 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | 103 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} |
104 | continue-on-error: true | 104 | continue-on-error: true |
105 | run: git merge --no-ff --no-verify --commit -m "Merge remote-tracking branch 'origin/develop' into HEAD" origin/develop | 105 | run: git merge --no-ff --no-verify --commit -m "Merge remote-tracking branch 'origin/develop' into HEAD" origin/develop |
106 | - name: Update submodules (continue if errored) | 106 | - id: should_run |
107 | name: Check whether there are any commits since this run was last triggered and either push or set the output | ||
107 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | 108 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} |
108 | continue-on-error: true | ||
109 | run: | | 109 | run: | |
110 | echo "Updating submodules" | ||
111 | git submodule update --remote -f | ||
112 | git commit -am "Update submodules" --no-verify || true | ||
113 | |||
114 | echo "Running linter and tests" | 110 | echo "Running linter and tests" |
115 | npm run lint && npm run test | 111 | npm run lint && npm run test |
116 | git commit -am "Apply linter fixes" --no-verify || true | 112 | git commit -am "Apply linter fixes" --no-verify || true |
117 | 113 | ||
118 | echo "Updating browserslist db" | ||
119 | npx browserslist@latest --update-db | ||
120 | git commit -am "Apply browserslist data updates" --no-verify || true | ||
121 | - id: should_run | ||
122 | name: Check whether there are any commits since this run was last triggered and either push or set the output | ||
123 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
124 | run: | | ||
125 | CHANGES_COUNT=$(git diff --shortstat origin/nightly | wc -l) | 114 | CHANGES_COUNT=$(git diff --shortstat origin/nightly | wc -l) |
126 | MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" | 115 | MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" |
127 | echo "Number of changes: $CHANGES_COUNT" | 116 | echo "Number of changes: $CHANGES_COUNT" |