Skip to content

Commit a2597ca

Browse files
authored
chore(ci): add variables for workflow_dispatch (#18)
- Add the clean command for Makefile
1 parent b7b2420 commit a2597ca

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

.github/workflows/rust-compiler-builder.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
11
name: Rust Compiler Builder
22

33
on:
4-
workflow_dispatch:
54
push:
65
paths-ignore:
76
- '**/README.md'
7+
workflow_dispatch:
8+
inputs:
9+
rust-backtrace:
10+
description: Enable RUST_BACKTRACE (0 or 1)
11+
required: false
12+
default: '1'
13+
type: choice
14+
options:
15+
- '0'
16+
- '1'
17+
rust-channel:
18+
description: Set RUST_CHANNEL (dev, nightly, beta, stable)
19+
required: false
20+
default: 'dev'
21+
type: choice
22+
options:
23+
- dev
24+
- nightly
25+
- beta
26+
- stable
27+
rust-verbose:
28+
description: Set RUST_VERBOSE level (0, 1, 2, 3)
29+
required: false
30+
default: '3'
31+
type: choice
32+
options:
33+
- '0'
34+
- '1'
35+
- '2'
36+
- '3'
837
schedule:
938
# https://crontab.guru/
1039
# At 12:00 AM
@@ -29,7 +58,6 @@ jobs:
2958
os: macos-13 # x86-64
3059
xcode-version: 14.3.1
3160
rust-config: configure
32-
rust-verbose-level: 3
3361
rust-use-lld: true
3462
macosx_deployment_target: 11.0
3563
iphoneos_deployment_target: 14.0
@@ -38,16 +66,19 @@ jobs:
3866
os: macos-13 # x86-64
3967
xcode-version: 14.3.1
4068
rust-config: configure
41-
rust-verbose-level: 3
4269
rust-use-lld: true
4370
macosx_deployment_target: 11.0
4471
iphoneos_deployment_target: 14.0
4572

4673
runs-on: ${{ matrix.os }}
4774
env:
75+
BOOTSTRAP_SKIP_TARGET_SANITY: 0
4876
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }}
4977
IPHONEOS_DEPLOYMENT_TARGET: ${{ matrix.iphoneos_deployment_target }}
78+
RUST_BACKTRACE: ${{ github.event.inputs.rust-backtrace || '0' }}
79+
RUST_CHANNEL: ${{ github.event.inputs.rust-channel || 'dev' }}
5080
RUST_TARGETS: ${{ matrix.rust-targets }}
81+
RUST_VERBOSE: ${{ github.event.inputs.rust-verbose || '0' }}
5182

5283
steps:
5384
- name: Install Xcode ${{ matrix.xcode-version }}
@@ -94,7 +125,6 @@ jobs:
94125
- name: Configure Rust
95126
run: make ${{ matrix.rust-config }}
96127
env:
97-
RUST_VERBOSE: ${{ matrix.rust-verbose-level }}
98128
RUST_USE_LLD: ${{ matrix.rust-use-lld }}
99129

100130
- name: Show config.toml
@@ -115,11 +145,11 @@ jobs:
115145
- name: Archive Rust dist
116146
uses: actions/upload-artifact@v4
117147
with:
118-
name: rust-${{ matrix.rust-targets }}_${{ matrix.xcode-version }}-${{ matrix.os }}
148+
name: rust-${{ env.RUST_CHANNEL }}-${{ matrix.rust-targets }}-${{ matrix.xcode-version }}-${{ matrix.os }}
119149
path: ./rust/build/dist/*.xz
120150

121151
- name: Archive target spec
122152
uses: actions/upload-artifact@v4
123153
with:
124-
name: rust-${{ matrix.rust-targets }}_${{ matrix.xcode-version }}-spec
154+
name: rust-${{ env.RUST_CHANNEL }}-${{ matrix.rust-targets }}-${{ matrix.xcode-version }}-spec
125155
path: ./*.json

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ RUST_USE_LLD ?= false
1313
help: ## Show this help
1414
@fgrep -h "## " $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/## //'
1515

16+
.PHONY: clean
17+
clean: ## Remove download artifacts
18+
rm -rf rust
19+
1620
# Note: use Makefile.local for customization
1721
-include misc/make/offline.Makefile
1822
-include Makefile.local
@@ -21,7 +25,7 @@ help: ## Show this help
2125

2226
.PHONY: download
2327
download: ## Download Rust sources
24-
git clone --recurse-submodules -j8 ${RUST_GIT_URL}
28+
git clone --recurse-submodules -j$(shell nproc) ${RUST_GIT_URL}
2529

2630
###
2731
# Configure: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Builds the *Rust* compiler and [Tier 3 targets](https://doc.rust-lang.org/nightl
99
```sh
1010
$ make
1111
help: Show this help
12+
clean: Remove download artifacts
1213
▸▸▸ Download commands ◂◂◂
1314
download: Download Rust sources
1415
▸▸▸ Configure commands ◂◂◂

0 commit comments

Comments
 (0)