Skip to content

Commit 488d6f1

Browse files
Use a matrix create parallel builds for each os
Using a matrix to run each build task greatly improves performances, since they can all start concurrently. The finishing time of the job will be equal to the one of the longer task to build, instead of being the sum of each individual task's finishing time.
1 parent 6c3755c commit 488d6f1

File tree

4 files changed

+42
-16
lines changed

4 files changed

+42
-16
lines changed

.github/workflows/publish-go-nightly-task.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ jobs:
2222
create-nightly-artifacts:
2323
runs-on: ubuntu-latest
2424

25+
strategy:
26+
matrix:
27+
os:
28+
- Windows_32bit
29+
- Windows_64bit
30+
- Linux_32bit
31+
- Linux_64bit
32+
- Linux_ARMv6
33+
- Linux_ARMv7
34+
- Linux_ARM64
35+
- macOS_64bit
36+
- macOS_ARM64
37+
2538
steps:
2639
- name: Checkout repository
2740
uses: actions/checkout@v3
@@ -35,7 +48,7 @@ jobs:
3548
- name: Build
3649
env:
3750
NIGHTLY: true
38-
run: task dist:all
51+
run: task dist:${{ matrix.os }}
3952

4053
- name: Upload artifacts
4154
uses: actions/upload-artifact@v3

.github/workflows/publish-go-tester-task.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ jobs:
5757
if: needs.run-determination.outputs.result == 'true'
5858
runs-on: ubuntu-latest
5959

60+
strategy:
61+
matrix:
62+
os:
63+
- Windows_32bit
64+
- Windows_64bit
65+
- Linux_32bit
66+
- Linux_64bit
67+
- Linux_ARMv6
68+
- Linux_ARMv7
69+
- Linux_ARM64
70+
- macOS_64bit
71+
- macOS_ARM64
72+
6073
steps:
6174
- name: Checkout repository
6275
uses: actions/checkout@v3
@@ -77,7 +90,7 @@ jobs:
7790
fi
7891
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
7992
export PACKAGE_NAME_PREFIX
80-
task dist:all
93+
task dist:${{ matrix.os }}
8194
8295
# Transfer builds to artifacts job
8396
- name: Upload combined builds artifact

.github/workflows/release-go-task.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ jobs:
1919
create-release-artifacts:
2020
runs-on: ubuntu-latest
2121

22+
strategy:
23+
matrix:
24+
os:
25+
- Windows_32bit
26+
- Windows_64bit
27+
- Linux_32bit
28+
- Linux_64bit
29+
- Linux_ARMv6
30+
- Linux_ARMv7
31+
- Linux_ARM64
32+
- macOS_64bit
33+
- macOS_ARM64
34+
2235
steps:
2336
- name: Checkout repository
2437
uses: actions/checkout@v3
@@ -40,7 +53,7 @@ jobs:
4053
version: 3.x
4154

4255
- name: Build
43-
run: task dist:all
56+
run: task dist:${{ matrix.os }}
4457

4558
- name: Upload artifacts
4659
uses: actions/upload-artifact@v3

DistTasks.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@ vars:
2323
CHECKSUM_FILE: "{{.VERSION}}-checksums.txt"
2424

2525
tasks:
26-
all:
27-
desc: Build for distribution for all platforms
28-
cmds:
29-
- task: Windows_32bit
30-
- task: Windows_64bit
31-
- task: Linux_32bit
32-
- task: Linux_64bit
33-
- task: Linux_ARMv6
34-
- task: Linux_ARMv7
35-
- task: Linux_ARM64
36-
- task: macOS_64bit
37-
- task: macOS_ARM64
38-
3926
Windows_32bit:
4027
desc: Builds Windows 32 bit binaries
4128
dir: "{{.DIST_DIR}}"

0 commit comments

Comments
 (0)