diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 699a9c417..1031706b9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -42,6 +42,9 @@ jobs: test: name: Build and test timeout-minutes: 60 + # NOTE: self-hosted riscv64 runners are experimental and may be flaky. + # Do not block CI on failures from this platform for now. + continue-on-error: ${{ matrix.os == 'self-hosted-riscv64' }} strategy: fail-fast: false matrix: @@ -72,6 +75,8 @@ jobs: os: ubuntu-24.04 - target: powerpc64le-unknown-linux-gnu os: ubuntu-24.04-ppc64le + - target: riscv64gc-unknown-linux-gnu + os: self-hosted-riscv64 - target: riscv64gc-unknown-linux-gnu os: ubuntu-24.04 - target: s390x-unknown-linux-gnu @@ -100,7 +105,9 @@ jobs: - target: x86_64-pc-windows-gnu os: windows-2025 channel: nightly-x86_64-gnu - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os || + matrix.os == 'self-hosted-riscv64' && fromJSON('["self-hosted","linux","riscv64"]') + }} needs: [calculate_vars] env: BUILD_ONLY: ${{ matrix.build_only }} @@ -133,8 +140,10 @@ jobs: rustup target add "${{ matrix.target }}" - uses: taiki-e/install-action@nextest + if: matrix.os != 'self-hosted-riscv64' - uses: Swatinem/rust-cache@v2 + if: matrix.os != 'self-hosted-riscv64' with: key: ${{ matrix.target }} - name: Cache Docker layers @@ -148,8 +157,18 @@ jobs: - uses: docker/setup-buildx-action@v3 if: matrix.os == 'ubuntu-24.04' + - name: Prepare mirrored sources (self-hosted riscv64) + if: matrix.os == 'self-hosted-riscv64' + run: | + sed -i 's|https://github.com|https://community-ci.openruyi.cn|g' ./ci/download-compiler-rt.sh + sed -i 's|llvm-project-rustc-${rust_llvm_version}|llvm-project|g' ./ci/download-compiler-rt.sh + sed -i 's|https://github.com/kraj/musl.git|https://community-ci.openruyi.cn/others/kraj-musl.git|g' ./ci/update-musl.sh + sed -i 's|https://github.com/japaric/utest|https://community-ci.openruyi.cn/others/japaric-utest|g' ./builtins-test/Cargo.toml + shell: bash + - name: Cache compiler-rt id: cache-compiler-rt + if: matrix.os != 'self-hosted-riscv64' uses: actions/cache@v4 with: path: compiler-rt @@ -166,7 +185,7 @@ jobs: shell: bash - name: Verify API list - if: matrix.os == 'ubuntu-24.04' + if: matrix.os == 'ubuntu-24.04' || matrix.os == 'self-hosted-riscv64' run: python3 etc/update-api-list.py --check # Non-linux tests just use our raw script