Skip to content

Commit 00a8738

Browse files
committed
Added parallel build to PR 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. A problem that we encountered is that with Python the resulting packed tars are very large. Each release is in the order of tens of megabytes. Using artifacts in our pipeline can easily make us surpass the maximum size limit for free GitHub accounts (500 MB). Because of this, we use the regular non-parallel pipeline for release build. Releasing the version from the same job the build was performed in allows us to directly access the build files instead of using artifacts. Separated release and MR pipelines.
1 parent 0a60aed commit 00a8738

File tree

2 files changed

+29
-14
lines changed

2 files changed

+29
-14
lines changed

.github/workflows/pr-pipeline.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: gdb-static-pr-pipeline
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
strategy:
11+
matrix:
12+
architecture: ["x86_64", "arm", "aarch64", "powerpc", "mips", "mipsel"]
13+
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Install dependencies
21+
run: sudo apt-get install -y wget
22+
23+
- name: Build
24+
run: make build-${{ matrix.architecture }} -j$((`nproc`+1))
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
name: gdb-static-pipeline
1+
name: gdb-static-release-pipeline
22

33
on:
4-
pull_request:
5-
branches:
6-
- '*'
74
push:
85
tags:
96
- 'v*'
107

8+
# Use a non-parallel single job pipeline because artifacts weigh too much. Instead,
9+
# simply build the files in the same job they are released.
1110
jobs:
12-
build:
11+
build_and_publish:
1312
runs-on: ubuntu-latest
14-
1513
steps:
1614
- uses: actions/checkout@v4
1715
with:
@@ -26,14 +24,7 @@ jobs:
2624
- name: Pack
2725
run: make pack
2826

29-
- name: Upload artifact
30-
uses: actions/upload-artifact@v4
31-
with:
32-
name: gdb-static
33-
path: build/artifacts/gdb-static*.tar.gz
34-
3527
- name: Publish release
36-
if: github.event_name == 'push'
3728
uses: softprops/action-gh-release@v2
3829
with:
39-
files: build/artifacts/gdb-static*.tar.gz
30+
files: build/artifacts/gdb-static*.tar.gz

0 commit comments

Comments
 (0)