summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2022-10-08 11:08:08 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-10-09 07:55:38 +0530
commita52e3f39ddf92f9d36bfe2f36e89873a1e127614 (patch)
tree18b4b26dc50f73acbef67dac52320485e8f89a17 /.github
parent6.2.1-nightly.12 [skip ci] (diff)
downloadferdium-app-a52e3f39ddf92f9d36bfe2f36e89873a1e127614.tar.gz
ferdium-app-a52e3f39ddf92f9d36bfe2f36e89873a1e127614.tar.zst
ferdium-app-a52e3f39ddf92f9d36bfe2f36e89873a1e127614.zip
Only run the dependencies update if there are any changes to be deployed
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/builds.yml57
-rw-r--r--.github/workflows/dependency-updates.yml69
2 files changed, 56 insertions, 70 deletions
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml
index 6721996d6..6c9df8950 100644
--- a/.github/workflows/builds.yml
+++ b/.github/workflows/builds.yml
@@ -26,7 +26,7 @@ on:
26 description: "Message for build" 26 description: "Message for build"
27 required: true 27 required: true
28 schedule: 28 schedule:
29 - cron: "15 0 * * *" # every night at 12:15 am (to allow for dependency builds to complete) 29 - cron: '0 0 * * *' # every night at 12 am
30 30
31env: 31env:
32 USE_HARD_LINKS: false 32 USE_HARD_LINKS: false
@@ -95,6 +95,61 @@ jobs:
95 git push origin $(git rev-parse --abbrev-ref HEAD) --no-verify 95 git push origin $(git rev-parse --abbrev-ref HEAD) --no-verify
96 fi 96 fi
97 97
98 dependency_updates:
99 name: "Update dependencies"
100 runs-on: ubuntu-20.04
101 needs: check_updates
102 if: ${{ needs.check_updates.outputs.should_run != 'false' }}
103 steps:
104 - name: Set env vars
105 run: |
106 echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV
107 echo "PNPM_CACHE=$HOME/.pnpm-store" >> $GITHUB_ENV
108 - name: Checkout code along with submodules
109 uses: actions/checkout@v3
110 with:
111 submodules: recursive
112 fetch-depth: 0 # Note: Needed to be able to pull the 'develop' branch as well for merging
113 - name: Extract Git branch name and commit from the currently checked out branch (not from the branch where this run was kicked off)
114 run: |
115 echo "GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
116 shell: bash
117 - name: Use Node.js specified in the '.nvmrc' file
118 uses: actions/setup-node@v3
119 with:
120 node-version-file: '.nvmrc'
121 - name: Install npm
122 run: npm i -gf "npm@$(node -p 'require("./package.json").engines.npm')" && npm -v
123 - name: Install pnpm
124 run: npm i -gf "pnpm@$(node -p 'require("./recipes/package.json").engines.pnpm')" && pnpm -v
125 - name: Install node dependencies
126 run: npm i
127 - name: Update submodules
128 run: |
129 rm -rf ./recipes
130 npm run update-submodules
131 git add .
132 echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV
133 - name: Update browserslist db
134 run: |
135 npx browserslist@latest --update-db
136 git add .
137 echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV
138 - name: Run linter, reformatter, rebrander and tests
139 if: ${{ env.GIT_DIRTY != '0' }}
140 run: |
141 npm run prepare-code
142 npm run test
143 - name: Commit submodules, dependency-updates and linter changes
144 if: ${{ env.GIT_DIRTY != '0' }}
145 run: |
146 git config user.name github-actions
147 git config user.email github-actions@github.com
148 git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify || true
149 - name: Push all changes
150 if: ${{ env.GIT_DIRTY != '0' }}
151 run: git push origin ${{ env.GIT_BRANCH_NAME }} --no-verify
152
98 build_mac: 153 build_mac:
99 name: "macos ${{ github.event.inputs.message }}" 154 name: "macos ${{ github.event.inputs.message }}"
100 needs: check_updates 155 needs: check_updates
diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml
deleted file mode 100644
index 93b1b9b79..000000000
--- a/.github/workflows/dependency-updates.yml
+++ /dev/null
@@ -1,69 +0,0 @@
1# This workflow will do a clean install of ferdium dev-dependencies, update the dependencies, build the source code and run tests. It will only run on scheduled trigger.
2
3name: Dependency updates
4
5on:
6 # Manual trigger from the UI
7 workflow_dispatch:
8 inputs:
9 message:
10 description: 'Message for build'
11 required: true
12 schedule:
13 - cron: '0 0 * * *' # every night at 12 am
14
15env:
16 USE_HARD_LINKS: false
17
18jobs:
19 dependency_updates:
20 runs-on: ubuntu-20.04
21 steps:
22 - name: Set env vars
23 run: |
24 echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV
25 echo "PNPM_CACHE=$HOME/.pnpm-store" >> $GITHUB_ENV
26 - name: Checkout code along with submodules
27 uses: actions/checkout@v3
28 with:
29 submodules: recursive
30 fetch-depth: 0 # Note: Needed to be able to pull the 'develop' branch as well for merging
31 - name: Extract Git branch name and commit from the currently checked out branch (not from the branch where this run was kicked off)
32 run: |
33 echo "GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
34 shell: bash
35 - name: Use Node.js specified in the '.nvmrc' file
36 uses: actions/setup-node@v3
37 with:
38 node-version-file: '.nvmrc'
39 - name: Install npm
40 run: npm i -gf "npm@$(node -p 'require("./package.json").engines.npm')" && npm -v
41 - name: Install pnpm
42 run: npm i -gf "pnpm@$(node -p 'require("./recipes/package.json").engines.pnpm')" && pnpm -v
43 - name: Install node dependencies
44 run: npm i
45 - name: Update submodules
46 run: |
47 rm -rf ./recipes
48 npm run update-submodules
49 git add .
50 echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV
51 - name: Update browserslist db
52 run: |
53 npx browserslist@latest --update-db
54 git add .
55 echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV
56 - name: Run linter, reformatter, rebrander and tests
57 if: ${{ env.GIT_DIRTY != '0' }}
58 run: |
59 npm run prepare-code
60 npm run test
61 - name: Commit submodules, dependency-updates and linter changes
62 if: ${{ env.GIT_DIRTY != '0' }}
63 run: |
64 git config user.name github-actions
65 git config user.email github-actions@github.com
66 git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify || true
67 - name: Push all changes
68 if: ${{ env.GIT_DIRTY != '0' }}
69 run: git push origin ${{ env.GIT_BRANCH_NAME }} --no-verify