Solaris+Fuchsia #891
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Solaris+Fuchsia | |
| on: | |
| push: | |
| branches: ["dev"] | |
| pull_request: | |
| branches: ["dev"] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| SCCACHE_GHA_ENABLED: "on" | |
| RUSTC_WRAPPER: "sccache" | |
| jobs: | |
| Linux: | |
| name: Solaris+Fuchsia | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Rust Toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rust-src | |
| targets: x86_64-fortanix-unknown-sgx | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| cache-workspace-crates: "true" | |
| - name: Run sccache-cache | |
| uses: mozilla-actions/sccache-action@main | |
| - name: Cross-rs | |
| run: | | |
| # cargo install cross --git https://github.com/cross-rs/cross --branch main -q | |
| if [ ! -f ~/.cargo/bin/cross ]; then | |
| wget -qO- https://github.com/cross-rs/cross/releases/latest/download/cross-x86_64-unknown-linux-gnu.tar.gz | tar -xz | |
| sudo mv cross ~/.cargo/bin/ | |
| fi | |
| cross --version | |
| - name: Cache Fuchsia | |
| uses: actions/cache@v5 | |
| with: | |
| path: /home/runner/Fuchsia | |
| key: Fuchsia | |
| restore-keys: Fuchsia | |
| - name: Ubuntu apt update and install | |
| run: | | |
| # sudo apt install -y protobuf-compiler | |
| # sudo apt install -y zfsutils-linux | |
| # - name: Cache Illumos/Solaris | |
| # uses: actions/cache@v5 | |
| # with: | |
| # path: /home/runner/Illumos | |
| # key: Illomos-${{ runner.os }}-${{ runner.arch }} | |
| # restore-keys: Illomos-${{ runner.os }}-${{ runner.arch }} | |
| - name: Build Release | |
| run: | | |
| cargo update | |
| set +e -x | |
| # mkdir -p /home/runner/Illumos | |
| # ln -sfn /home/runner/Illumos Illumos | |
| # if [ ! -f Illumos/omnios-r151056.zfs ]; then | |
| # mkdir -p Illumos/omnios | |
| # curl -fsSL https://downloads.omnios.org/media/stable/omnios-r151056.zfs.xz | xz -d > Illumos/omnios-r151056.zfs | |
| # fi | |
| # sudo truncate -s 1G /tmp/omnios.img | |
| # sudo zpool create -f solaris /tmp/omnios.img | |
| # sudo zfs recv -o mountpoint=/home/runner/Illumos/omnios solaris/omnios < Illumos/omnios-r151056.zfs | |
| # zpool status | |
| # zfs list | |
| if [ ! -d /home/runner/Fuchsia ]; then | |
| curl -LsSf 'https://chrome-infra-packages.appspot.com/client?platform=linux-amd64&version=latest' -o cipd | |
| chmod +x cipd | |
| sudo mv cipd /usr/local/bin/ | |
| mkdir -p /home/runner/Fuchsia | |
| cipd install fuchsia/sdk/core/linux-amd64 latest -root /home/runner/Fuchsia | |
| fi | |
| ln -sf /home/runner/Fuchsia fuchsia | |
| # cargo install fortanix-sgx-tools sgxs-tools -q | |
| # sudo snap install zig --classic --beta | |
| targets=( | |
| aarch64-unknown-hermit | |
| riscv64gc-unknown-hermit | |
| x86_64-unknown-hermit | |
| ) | |
| mv .cargo/config.toml .cargo/config.toml.bak | |
| mv .cargo/hermit.toml .cargo/config.toml | |
| for target in ${targets[@]}; do | |
| time cargo s $target | |
| done | |
| targets=( | |
| x86_64-fortanix-unknown-sgx | |
| aarch64-unknown-fuchsia | |
| riscv64gc-unknown-fuchsia | |
| x86_64-unknown-fuchsia | |
| ) | |
| mv .cargo/config.toml .cargo/hermit.toml | |
| mv .cargo/config.toml.bak .cargo/config.toml | |
| for target in ${targets[@]}; do | |
| time cargo s $target | |
| done | |
| targets=( | |
| x86_64-unknown-illumos | |
| x86_64-sun-solaris | |
| x86_64-pc-solaris | |
| sparcv9-sun-solaris | |
| ) | |
| for target in ${targets[@]}; do | |
| export CROSS_IMAGE=ghcr.io/cross-rs/${target}:main | |
| time cross build -q --config 'build.rustc-wrapper=""' --profile src -Zbuild-std=std,panic_abort -Zbuild-std-features=optimize_for_size --target $target | |
| done | |
| # sudo zfs destroy -r solaris/omnios | |
| # sudo zpool destroy solaris | |
| find ./target -iname img -type f | xargs ls -hl | |
| lscpu | |
| free -m | |
| - name: Rust Versions | |
| run: rustup -V; cargo -Vv; rustc -Vv | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-output | |
| path: | | |
| target/**/img* | |
| !target/**/*.d | |
| if-no-files-found: ignore | |
| - name: Upload binaries to a GitHub release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| targets=( | |
| aarch64-unknown-hermit | |
| riscv64gc-unknown-hermit | |
| x86_64-unknown-hermit | |
| x86_64-unknown-illumos | |
| aarch64-unknown-fuchsia | |
| riscv64gc-unknown-fuchsia | |
| x86_64-unknown-fuchsia | |
| x86_64-fortanix-unknown-sgx | |
| x86_64-pc-solaris | |
| sparcv9-sun-solaris | |
| ) | |
| for target in "${targets[@]}"; do | |
| IFS='-' read -r arch vendor os abi <<< "$target" | |
| if [[ -n "$abi" ]]; then | |
| if [[ "$os" == "unknown" ]]; then | |
| name="${vendor^}-${abi}" | |
| else | |
| name="${os^}-${arch}-${abi}" | |
| fi | |
| else | |
| name="${os^}-${arch}" | |
| fi | |
| echo "Uploading $name..." | |
| mv target/$target/src/img target/$target/src/$name || true | |
| gh release upload Nightly target/$target/src/$name --clobber || true | |
| done |