Skip to content

Commit b96d13f

Browse files
committed
This is one commit drafted to support CI job on riscv64 self hosted runner
1 parent 65624df commit b96d13f

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/main.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
test:
4343
name: Build and test
4444
timeout-minutes: 60
45+
# NOTE: self-hosted riscv64 runners are experimental and may be flaky.
46+
# Do not block CI on failures from this platform for now.
47+
continue-on-error: ${{ matrix.os == 'self-hosted-riscv64' }}
4548
strategy:
4649
fail-fast: false
4750
matrix:
@@ -72,6 +75,8 @@ jobs:
7275
os: ubuntu-24.04
7376
- target: powerpc64le-unknown-linux-gnu
7477
os: ubuntu-24.04-ppc64le
78+
- target: riscv64gc-unknown-linux-gnu
79+
os: self-hosted-riscv64
7580
- target: riscv64gc-unknown-linux-gnu
7681
os: ubuntu-24.04
7782
- target: s390x-unknown-linux-gnu
@@ -100,7 +105,9 @@ jobs:
100105
- target: x86_64-pc-windows-gnu
101106
os: windows-2025
102107
channel: nightly-x86_64-gnu
103-
runs-on: ${{ matrix.os }}
108+
runs-on: ${{ matrix.os ||
109+
matrix.os == 'self-hosted-riscv64' && fromJSON('["self-hosted","linux","riscv64"]')
110+
}}
104111
needs: [calculate_vars]
105112
env:
106113
BUILD_ONLY: ${{ matrix.build_only }}
@@ -133,8 +140,10 @@ jobs:
133140
rustup target add "${{ matrix.target }}"
134141
135142
- uses: taiki-e/install-action@nextest
143+
if: matrix.os != 'self-hosted-riscv64'
136144

137145
- uses: Swatinem/rust-cache@v2
146+
if: matrix.os != 'self-hosted-riscv64'
138147
with:
139148
key: ${{ matrix.target }}
140149
- name: Cache Docker layers
@@ -148,8 +157,18 @@ jobs:
148157
- uses: docker/setup-buildx-action@v3
149158
if: matrix.os == 'ubuntu-24.04'
150159

160+
- name: Prepare mirrored sources (self-hosted riscv64)
161+
if: matrix.os == 'self-hosted-riscv64'
162+
run: |
163+
sed -i 's|https://github.com|https://community-ci.openruyi.cn|g' ./ci/download-compiler-rt.sh
164+
sed -i 's|llvm-project-rustc-${rust_llvm_version}|llvm-project|g' ./ci/download-compiler-rt.sh
165+
sed -i 's|https://github.com/kraj/musl.git|https://community-ci.openruyi.cn/others/kraj-musl.git|g' ./ci/update-musl.sh
166+
sed -i 's|https://github.com/japaric/utest|https://community-ci.openruyi.cn/others/japaric-utest|g' ./builtins-test/Cargo.toml
167+
shell: bash
168+
151169
- name: Cache compiler-rt
152170
id: cache-compiler-rt
171+
if: matrix.os != 'self-hosted-riscv64'
153172
uses: actions/cache@v4
154173
with:
155174
path: compiler-rt
@@ -166,7 +185,7 @@ jobs:
166185
shell: bash
167186

168187
- name: Verify API list
169-
if: matrix.os == 'ubuntu-24.04'
188+
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'self-hosted-riscv64'
170189
run: python3 etc/update-api-list.py --check
171190

172191
# Non-linux tests just use our raw script

0 commit comments

Comments
 (0)