diff options
author | Vijay A <avijayr@protonmail.com> | 2021-06-30 08:43:35 +0530 |
---|---|---|
committer | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-06-30 15:15:34 +0530 |
commit | bdc074ec2f20d5385f34ae9b1bc467180639f850 (patch) | |
tree | 071288bcf8eba148b537fe47e3217540376c6b4b /.github | |
parent | Split up the dependency updates into its own scheduled job and to be run on t... (diff) | |
download | ferdium-app-bdc074ec2f20d5385f34ae9b1bc467180639f850.tar.gz ferdium-app-bdc074ec2f20d5385f34ae9b1bc467180639f850.tar.zst ferdium-app-bdc074ec2f20d5385f34ae9b1bc467180639f850.zip |
Simplified the scheduled nightly build since the linter and tests are anyways run on the different OS-based jobs.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/dependency-updates.yml | 6 | ||||
-rw-r--r-- | .github/workflows/ferdi-builds.yml | 67 |
2 files changed, 7 insertions, 66 deletions
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: | |||
42 | npm i -g node-gyp@8.0.0 && npm config set node_gyp "$(which 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 | 43 | - name: Install node dependencies recursively |
44 | run: npx lerna bootstrap | 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 | 45 | - name: Update submodules, dependencies and run tests |
50 | run: | | 46 | run: | |
51 | echo "Updating submodules" | 47 | echo "Updating submodules" |
@@ -59,5 +55,7 @@ jobs: | |||
59 | npm run test | 55 | npm run test |
60 | 56 | ||
61 | echo "Committing and pushing submodules, dependency-updates and linter changes" | 57 | echo "Committing and pushing submodules, dependency-updates and linter changes" |
58 | git config user.name github-actions | ||
59 | git config user.email github-actions@github.com | ||
62 | git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify || true | 60 | git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify || true |
63 | git push origin nightly --no-verify | 61 | 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: | |||
37 | outputs: | 37 | outputs: |
38 | should_run: ${{ steps.should_run.outputs.should_run }} | 38 | should_run: ${{ steps.should_run.outputs.should_run }} |
39 | steps: | 39 | steps: |
40 | - name: Set env vars | ||
41 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
42 | run: | | ||
43 | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV | ||
44 | echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV | ||
45 | echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV | ||
46 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' | 40 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' |
47 | uses: actions/checkout@v2 | 41 | uses: actions/checkout@v2 |
48 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | 42 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} |
@@ -50,66 +44,15 @@ jobs: | |||
50 | ref: nightly | 44 | ref: nightly |
51 | submodules: recursive | 45 | submodules: recursive |
52 | fetch-depth: 0 | 46 | fetch-depth: 0 |
53 | - name: Cache node modules | 47 | - id: should_run |
54 | uses: actions/cache@v2 | 48 | name: Check whether there are any commits since this run was last triggered and push them and/or set the output |
55 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
56 | env: | ||
57 | cache-name: cache-node-modules | ||
58 | with: | ||
59 | path: ${{ env.NPM_CACHE }} | ||
60 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
61 | restore-keys: | | ||
62 | ${{ runner.os }}-build-${{ env.cache-name }}- | ||
63 | ${{ runner.os }}-build- | ||
64 | ${{ runner.os }}- | ||
65 | - name: Cache electron modules | ||
66 | uses: actions/cache@v2 | ||
67 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
68 | env: | ||
69 | cache-name: cache-electron-modules | ||
70 | with: | ||
71 | key: ${{ runner.os }}-${{ env.cache-name }} | ||
72 | path: ${{ env.ELECTRON_CACHE }} | ||
73 | - name: Cache electron-builder modules | ||
74 | uses: actions/cache@v2 | ||
75 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
76 | env: | ||
77 | cache-name: cache-electron-builder-modules | ||
78 | with: | ||
79 | key: ${{ runner.os }}-${{ env.cache-name }} | ||
80 | path: ${{ env.ELECTRON_BUILDER_CACHE }} | ||
81 | - name: Use Node.js 14.16.1 | ||
82 | uses: actions/setup-node@v2 | ||
83 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
84 | with: | ||
85 | node-version: 14.16.1 | ||
86 | - name: Uninstall locally and reinstall node-gyp globally | ||
87 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
88 | run: | | ||
89 | npm uninstall node-gyp | ||
90 | npm i -g node-gyp@8.0.0 && npm config set node_gyp "$(which node-gyp)" | ||
91 | - name: Install node dependencies recursively | ||
92 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
93 | run: npx lerna bootstrap | ||
94 | - name: Print latest commit | ||
95 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
96 | run: echo ${{ github.sha }} | ||
97 | - name: Setup git configs | ||
98 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | 49 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} |
99 | run: | | 50 | run: | |
100 | git config user.name github-actions | 51 | git config user.name github-actions |
101 | git config user.email github-actions@github.com | 52 | git config user.email github-actions@github.com |
102 | - name: Merge from 'origin/develop' (continue if errored) | 53 | |
103 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | 54 | echo "Merge from 'origin/develop'" |
104 | continue-on-error: true | 55 | 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 | - id: should_run | ||
107 | name: Check whether there are any commits since this run was last triggered and either push or set the output | ||
108 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | ||
109 | run: | | ||
110 | echo "Running linter and tests" | ||
111 | npm run lint && npm run test | ||
112 | git commit -am "Apply linter fixes" --no-verify || true | ||
113 | 56 | ||
114 | CHANGES_COUNT=$(git diff --shortstat origin/nightly | wc -l) | 57 | CHANGES_COUNT=$(git diff --shortstat origin/nightly | wc -l) |
115 | MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" | 58 | MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" |