Skip to content

Commit e9264ce

Browse files
committed
Added parallel build to workflow
Using a matrix and job separation we can make the architectures compile parallel to eachother, hopefully reducing the time required for builds and also simplifying the process of building a single architecture. Also modified the pipeline to only upload artifacts if we later use them to create a release (I.e, only upload artifacts on tag push actions).
1 parent 3f97468 commit e9264ce

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

.github/workflows/pipeline.yaml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ on:
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
architecture: ["x86_64", "arm", "aarch64", "powerpc", "mips", "mipsel"]
1416

17+
runs-on: ubuntu-latest
1518
steps:
1619
- uses: actions/checkout@v4
1720
with:
@@ -21,19 +24,32 @@ jobs:
2124
run: sudo apt-get install -y wget
2225

2326
- name: Build
24-
run: make build -j$((`nproc`+1))
27+
run: make build-${{ matrix.architecture }} -j$((`nproc`+1))
2528

29+
# We only need to create & upload artifacts if we are creating a new version.
2630
- name: Pack
27-
run: make pack
31+
if: github.event_name == 'push'
32+
run: make pack-${{ matrix.architecture }}
2833

2934
- name: Upload artifact
3035
uses: actions/upload-artifact@v4
36+
if: github.event_name == 'push'
3137
with:
3238
name: gdb-static
3339
path: build/artifacts/gdb-static*.tar.gz
3440

35-
- name: Publish release
36-
if: github.event_name == 'push'
37-
uses: softprops/action-gh-release@v2
38-
with:
39-
files: build/artifacts/gdb-static*.tar.gz
41+
create_and_publish_release:
42+
runs-on: ubuntu-latest
43+
needs: build
44+
if: github.event_name == 'push'
45+
46+
steps:
47+
- name: Download build artifacts
48+
uses: actions/download-artifact@v4
49+
with:
50+
path: "build-results/"
51+
52+
- name: Publish release.
53+
uses: softprops/action-gh-release@v2
54+
with:
55+
files: build-results/*

0 commit comments

Comments
 (0)