Skip to content

Commit f41efa4

Browse files
committed
ci: source target triple from matrix.sh
1 parent a7d11f8 commit f41efa4

File tree

4 files changed

+31
-36
lines changed

4 files changed

+31
-36
lines changed

.github/workflows/build-depends.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,17 @@ on:
1111
description: "Path to built container at registry"
1212
required: true
1313
type: string
14-
host:
15-
description: "Target triplet"
16-
required: true
17-
type: string
1814
outputs:
1915
key:
2016
description: "Key needed for restoring depends cache"
21-
value: ${{ jobs.build-depends.restore.outputs.cache-primary-key }}
17+
value: ${{ jobs.build-depends.outputs.key }}
2218

2319
jobs:
2420
build-depends:
2521
name: Build depends
2622
runs-on: ubuntu-22.04
23+
outputs:
24+
key: ${{ steps.restore.outputs.cache-primary-key }}
2725
container:
2826
image: ${{ inputs.container-path }}
2927
options: --user root
@@ -33,6 +31,14 @@ jobs:
3331
with:
3432
ref: ${{ github.event.pull_request.head.sha }}
3533

34+
- name: Initial setup
35+
id: setup
36+
run: |
37+
BUILD_TARGET="${{ inputs.build-target }}"
38+
source ./ci/dash/matrix.sh
39+
echo "HOST=${HOST}" >> $GITHUB_OUTPUT
40+
shell: bash
41+
3642
- name: Cache depends sources
3743
uses: actions/cache@v4
3844
with:
@@ -49,20 +55,20 @@ jobs:
4955
with:
5056
path: |
5157
depends/built
52-
depends/${{ inputs.host }}
58+
depends/${{ steps.setup.outputs.HOST }}
5359
key: ${{ runner.os }}-depends-${{ inputs.build-target }}-${{ hashFiles('depends/packages/*') }}
5460
restore-keys: |
5561
${{ runner.os }}-depends-${{ inputs.build-target }}-${{ hashFiles('depends/packages/*') }}
5662
${{ runner.os }}-depends-${{ inputs.build-target }}
5763
5864
- name: Build depends
59-
run: env HOST=${{ inputs.host }} make -j$(nproc) -C depends
65+
run: env HOST=${{ steps.setup.outputs.HOST }} make -j$(nproc) -C depends
6066

6167
- name: Save depends cache
6268
uses: actions/cache/save@v4
6369
if: steps.restore.outputs.cache-hit != 'true'
6470
with:
6571
path: |
6672
depends/built
67-
depends/${{ inputs.host }}
73+
depends/${{ steps.setup.outputs.HOST }}
6874
key: ${{ steps.restore.outputs.cache-primary-key }}

.github/workflows/build-src.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ on:
1515
description: "Key needed to access cached depends"
1616
required: true
1717
type: string
18-
host:
19-
description: "Target triplet"
20-
required: true
21-
type: string
2218

2319
jobs:
2420
build-src:
@@ -34,20 +30,29 @@ jobs:
3430
ref: ${{ github.event.pull_request.head.sha }}
3531
fetch-depth: 0
3632

33+
- name: Initial setup
34+
id: setup
35+
run: |
36+
git config --global --add advice.detachedHead false
37+
git config --global --add safe.directory "$PWD"
38+
GIT_HEAD="$(git rev-parse HEAD)"
39+
git checkout develop
40+
git checkout "${GIT_HEAD}"
41+
BUILD_TARGET="${{ inputs.build-target }}"
42+
source ./ci/dash/matrix.sh
43+
echo "HOST=${HOST}" >> $GITHUB_OUTPUT
44+
echo "PR_BASE_SHA=${{ github.event.pull_request.base.sha || '' }}" >> $GITHUB_OUTPUT
45+
shell: bash
46+
3747
- name: Restore depends cache
3848
uses: actions/cache/restore@v4
3949
with:
4050
path: |
4151
depends/built
42-
depends/${{ inputs.host }}
52+
depends/${{ steps.setup.outputs.HOST }}
4353
key: ${{ inputs.depends-key }}
4454
fail-on-cache-miss: true
4555

46-
- name: Determine PR Base SHA
47-
id: vars
48-
run: |
49-
echo "PR_BASE_SHA=${{ github.event.pull_request.base.sha || '' }}" >> $GITHUB_OUTPUT
50-
5156
- name: Manage ccache
5257
uses: actions/cache@v4
5358
with:
@@ -56,16 +61,11 @@ jobs:
5661
key: ${{ runner.os }}-${{ inputs.build-target }}-${{ github.sha }}
5762
restore-keys: |
5863
${{ runner.os }}-${{ inputs.build-target }}-${{ github.sha }}
59-
${{ runner.os }}-${{ inputs.build-target }}-${{ steps.vars.outputs.PR_BASE_SHA }}
64+
${{ runner.os }}-${{ inputs.build-target }}-${{ steps.setup.outputs.HOST }}
6065
${{ runner.os }}-${{ inputs.build-target }}
6166
6267
- name: Build source and run unit tests
6368
run: |
64-
git config --global --add advice.detachedHead false
65-
git config --global --add safe.directory "$PWD"
66-
GIT_HEAD="$(git rev-parse HEAD)"
67-
git checkout develop
68-
git checkout ${GIT_HEAD}
6969
CCACHE_SIZE="400M"
7070
CACHE_DIR="/cache"
7171
mkdir /output

.github/workflows/build.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
with:
2525
build-target: arm-linux
2626
container-path: ${{ needs.container.outputs.path }}
27-
host: arm-linux-gnueabihf
2827

2928
depends-linux64:
3029
name: x86_64-pc-linux-gnu
@@ -33,7 +32,6 @@ jobs:
3332
with:
3433
build-target: linux64
3534
container-path: ${{ needs.container.outputs.path }}
36-
host: x86_64-pc-linux-gnu
3735

3836
depends-win64:
3937
name: x86_64-w64-mingw32
@@ -42,7 +40,6 @@ jobs:
4240
with:
4341
build-target: win64
4442
container-path: ${{ needs.container.outputs.path }}
45-
host: x86_64-w64-mingw32
4643

4744
src-arm-linux:
4845
name: arm-linux-build
@@ -52,7 +49,6 @@ jobs:
5249
build-target: arm-linux
5350
container-path: ${{ needs.container.outputs.path }}
5451
depends-key: ${{ needs.depends-arm-linux.outputs.key }}
55-
host: arm-linux-gnueabihf
5652

5753
src-linux64:
5854
name: linux64-build
@@ -62,7 +58,6 @@ jobs:
6258
build-target: linux64
6359
container-path: ${{ needs.container.outputs.path }}
6460
depends-key: ${{ needs.depends-linux64.outputs.key }}
65-
host: x86_64-pc-linux-gnu
6661

6762
src-linux64_cxx20:
6863
name: linux64_cxx20-build
@@ -72,7 +67,6 @@ jobs:
7267
build-target: linux64_cxx20
7368
container-path: ${{ needs.container.outputs.path }}
7469
depends-key: ${{ needs.depends-linux64.outputs.key }}
75-
host: x86_64-pc-linux-gnu
7670

7771
src-linux64_fuzz:
7872
name: linux64_fuzz-build
@@ -82,7 +76,6 @@ jobs:
8276
build-target: linux64_fuzz
8377
container-path: ${{ needs.container.outputs.path }}
8478
depends-key: ${{ needs.depends-linux64.outputs.key }}
85-
host: x86_64-pc-linux-gnu
8679

8780
src-linux64_nowallet:
8881
name: linux64_nowallet-build
@@ -92,7 +85,6 @@ jobs:
9285
build-target: linux64_nowallet
9386
container-path: ${{ needs.container.outputs.path }}
9487
depends-key: ${{ needs.depends-linux64.outputs.key }}
95-
host: x86_64-pc-linux-gnu
9688

9789
src-linux64_sqlite:
9890
name: linux64_sqlite-build
@@ -102,7 +94,6 @@ jobs:
10294
build-target: linux64_sqlite
10395
container-path: ${{ needs.container.outputs.path }}
10496
depends-key: ${{ needs.depends-linux64.outputs.key }}
105-
host: x86_64-pc-linux-gnu
10697

10798
src-linux64_tsan:
10899
name: linux64_tsan-build
@@ -112,7 +103,6 @@ jobs:
112103
build-target: linux64_tsan
113104
container-path: ${{ needs.container.outputs.path }}
114105
depends-key: ${{ needs.depends-linux64.outputs.key }}
115-
host: x86_64-pc-linux-gnu
116106

117107
src-linux64_ubsan:
118108
name: linux64_ubsan-build
@@ -122,7 +112,6 @@ jobs:
122112
build-target: linux64_ubsan
123113
container-path: ${{ needs.container.outputs.path }}
124114
depends-key: ${{ needs.depends-linux64.outputs.key }}
125-
host: x86_64-pc-linux-gnu
126115

127116
src-win64:
128117
name: win64-build
@@ -132,4 +121,3 @@ jobs:
132121
build-target: win64
133122
container-path: ${{ needs.container.outputs.path }}
134123
depends-key: ${{ needs.depends-win64.outputs.key }}
135-
host: x86_64-w64-mingw32

ci/test/00_setup_env_native_qt5.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_qt5
10+
export HOST=x86_64-pc-linux-gnu
1011
export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
1112
export DEP_OPTS="NO_UPNP=1 DEBUG=1"
1213
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_pruning,feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash

0 commit comments

Comments
 (0)