Skip to content

Commit ee731a8

Browse files
authored
Merge pull request #3529 from reubenmiller/ci-refactor-build-script
ci: refactor build script and workflow
2 parents 2085b03 + 23c0e96 commit ee731a8

File tree

4 files changed

+196
-117
lines changed

4 files changed

+196
-117
lines changed

.github/workflows/build-workflow.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ on:
1818
type: string
1919
required: false
2020
default: "10"
21-
run_rust_tests:
22-
description: Run Rust tests (generally this is not required as the PR check will run full Rust tests)
23-
type: boolean
24-
required: false
25-
default: false
2621

2722
# Use a manual approval process before PR's are given access to
2823
# the secrets which are required to run the integration tests.
@@ -57,49 +52,60 @@ jobs:
5752
- riscv64gc-unknown-linux-gnu
5853
- aarch64-apple-darwin
5954
- x86_64-apple-darwin
60-
mode:
61-
- --release
6255

6356
rust_channel:
6457
- "1.78"
6558

6659
include:
6760
- target: aarch64-unknown-linux-musl
61+
build_with: auto
6862
host_os: ubuntu-22.04
6963
cargo_options: --no-run
7064

7165
- target: armv7-unknown-linux-musleabihf
66+
build_with: auto
7267
host_os: ubuntu-22.04
7368
cargo_options: --no-run
7469

7570
- target: arm-unknown-linux-musleabihf
71+
build_with: auto
7672
host_os: ubuntu-22.04
7773
cargo_options: --no-run
7874

7975
- target: arm-unknown-linux-musleabi
76+
build_with: auto
8077
host_os: ubuntu-22.04
8178
cargo_options: --no-run
8279

8380
- target: armv5te-unknown-linux-musleabi
81+
build_with: clang
8482
host_os: ubuntu-22.04
8583
cargo_options: --no-run
8684

8785
- target: x86_64-unknown-linux-musl
86+
build_with: auto
8887
host_os: ubuntu-22.04
8988

9089
- target: i686-unknown-linux-musl
90+
build_with: auto
9191
host_os: ubuntu-22.04
9292
cargo_options: --no-run
9393

94+
# Note: riscv64gc-unknown-linux-musl is meant to be supported from 1.82
95+
# but there are still some build problems which prevent it from being used.
96+
# So stick to gnu build only
9497
- target: riscv64gc-unknown-linux-gnu
98+
build_with: auto
9599
host_os: ubuntu-22.04
96100
cargo_options: --no-run
97101

98102
- target: aarch64-apple-darwin
103+
build_with: clang
99104
host_os: macos-14
100105
cargo_options: --no-run
101106

102107
- target: x86_64-apple-darwin
108+
build_with: clang
103109
host_os: macos-14
104110

105111
steps:
@@ -112,28 +118,17 @@ jobs:
112118
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }}
113119
fetch-depth: 0
114120

115-
- run: mk/install-build-tools.sh +${{ matrix.rust_channel }} --target=${{ matrix.target }}
116-
shell: sh
117-
- name: Build
118-
run: |
119-
. ./ci/build_scripts/version.sh
120-
mk/cargo.sh +${{ matrix.rust_channel }} build --target=${{ matrix.target }} ${{ matrix.mode }}
121-
122-
- if: ${{ inputs.run_rust_tests && !contains(matrix.host_os, 'windows') }}
123-
name: Test
124-
run: |
125-
mk/cargo.sh +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.mode }} --no-fail-fast --locked --all-features --all-targets
126-
127121
# Install nfpm used to for linux packaging
128122
- uses: actions/setup-go@v5
129123
with:
130124
go-version: 'stable'
131125
cache: false
132126
- run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
133127

134-
- name: Package
128+
- uses: taiki-e/install-action@just
129+
- name: build
135130
run: |
136-
./ci/build_scripts/build.sh ${{ matrix.target }} --skip-build --skip-deprecated-packages
131+
just release ${{ matrix.target }} --toolchain ${{ matrix.rust_channel }} --build-with ${{ matrix.build_with }}
137132
138133
- name: Upload packages as zip
139134
# https://github.com/marketplace/actions/upload-a-build-artifact

0 commit comments

Comments
 (0)