Skip to content

Commit 66f6787

Browse files
PastaPastaPastaknst
authored andcommitted
Merge dashpay#6401: ci: deduplicate depends building
2f18c1a ci: deduplicate depends building (pasta) Pull request description: ## Issue being fixed or feature implemented Currently we build the same host / options multiple times. Don't do this! ## What was done? Now building depends only twice ## How Has This Been Tested? Local CI appears to be working ## Breaking Changes None ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: kwvg: utACK 2f18c1a UdjinM6: utACK 2f18c1a Tree-SHA512: 67460508a2e9458152f7c8bb5f4a1a786aedcfded0e5c54fb03d85010ba8bb87362b66a0c322b51aeba75752e36418fc235d8dc4197ef10695e234ccc5a00a39
1 parent 7ca5663 commit 66f6787

File tree

1 file changed

+18
-52
lines changed

1 file changed

+18
-52
lines changed

.github/workflows/build.yml

+18-52
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
with:
2626
ref: ${{ github.event.pull_request.head.sha }}
2727

28-
2928
- name: Prepare
3029
id: prepare
3130
run: |
@@ -68,18 +67,6 @@ jobs:
6867
host: arm-linux-gnueabihf
6968
- build_target: linux64
7069
host: x86_64-pc-linux-gnu
71-
- build_target: linux64_tsan
72-
host: x86_64-pc-linux-gnu
73-
- build_target: linux64_ubsan
74-
host: x86_64-pc-linux-gnu
75-
- build_target: linux64_fuzz
76-
host: x86_64-pc-linux-gnu
77-
- build_target: linux64_cxx20
78-
host: x86_64-pc-linux-gnu
79-
- build_target: linux64_sqlite
80-
host: x86_64-pc-linux-gnu
81-
- build_target: linux64_nowallet
82-
host: x86_64-pc-linux-gnu
8370

8471
container:
8572
image: ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-ci-runner:${{ needs.build-image.outputs.image-tag }}
@@ -90,7 +77,6 @@ jobs:
9077
with:
9178
ref: ${{ github.event.pull_request.head.sha }}
9279

93-
9480
- name: Cache depends sources
9581
uses: actions/cache@v4
9682
with:
@@ -113,6 +99,12 @@ jobs:
11399
- name: Build dependencies
114100
run: make -j$(nproc) -C depends HOST=${{ matrix.host }}
115101

102+
- name: Upload built depends
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: depends-${{ matrix.build_target }}
106+
path: depends/${{ matrix.host }}
107+
116108
build:
117109
name: Build
118110
needs: [build-image, build-depends]
@@ -123,20 +115,28 @@ jobs:
123115
include:
124116
- build_target: arm-linux
125117
host: arm-linux-gnueabihf
118+
depends_on: arm-linux
126119
- build_target: linux64
127120
host: x86_64-pc-linux-gnu
121+
depends_on: linux64
128122
- build_target: linux64_tsan
129123
host: x86_64-pc-linux-gnu
124+
depends_on: linux64
130125
- build_target: linux64_ubsan
131126
host: x86_64-pc-linux-gnu
127+
depends_on: linux64
132128
- build_target: linux64_fuzz
133129
host: x86_64-pc-linux-gnu
130+
depends_on: linux64
134131
- build_target: linux64_cxx20
135132
host: x86_64-pc-linux-gnu
133+
depends_on: linux64
136134
- build_target: linux64_sqlite
137135
host: x86_64-pc-linux-gnu
136+
depends_on: linux64
138137
- build_target: linux64_nowallet
139138
host: x86_64-pc-linux-gnu
139+
depends_on: linux64
140140
container:
141141
image: ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-ci-runner:${{ needs.build-image.outputs.image-tag }}
142142
options: --user root
@@ -146,16 +146,11 @@ jobs:
146146
with:
147147
ref: ${{ github.event.pull_request.head.sha }}
148148

149-
150-
- name: Restore Cache dependencies
151-
uses: actions/cache/restore@v4
149+
- name: Download built depends
150+
uses: actions/download-artifact@v4
152151
with:
153-
path: |
154-
depends/${{ matrix.host }}
155-
key: ${{ runner.os }}-depends-${{ matrix.build_target }}-${{ hashFiles('depends/packages/*') }}
156-
restore-keys: |
157-
${{ runner.os }}-depends-${{ matrix.build_target }}-${{ hashFiles('depends/packages/*') }}
158-
${{ runner.os }}-depends-${{ matrix.build_target }}
152+
name: depends-${{ matrix.depends_on }}
153+
path: depends/${{ matrix.host }}
159154

160155
- name: Determine PR Base SHA
161156
id: vars
@@ -192,32 +187,3 @@ jobs:
192187
name: build-artifacts-${{ matrix.build_target }}
193188
path: |
194189
/output
195-
196-
197-
# Come back to this later and implement tests :)
198-
# test:
199-
# name: Test
200-
# needs: [build-image, build]
201-
# runs-on: ubuntu-22.04
202-
# container:
203-
# image: ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-ci-runner:${{ needs.build-image.outputs.image-tag }}
204-
# options: --user root
205-
# steps:
206-
# - name: Checkout code
207-
# uses: actions/checkout@v4
208-
# with:
209-
# ref: ${{ github.event.pull_request.head.sha }}
210-
#
211-
# - name: Download build artifacts
212-
# uses: actions/download-artifact@v4
213-
# with:
214-
# name: build-artifacts
215-
# path: src/
216-
#
217-
## - name: Setup environment
218-
## run: |
219-
## echo "BUILD_TARGET=${{ needs.build.matrix.build_target }}"
220-
## source ./ci/dash/matrix.sh
221-
#
222-
# - name: Run integration tests
223-
# run: ./ci/dash/test_integrationtests.sh --extended --exclude feature_pruning,feature_dbcrash

0 commit comments

Comments
 (0)