Skip to content

Commit

Permalink
merge from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshine-lcc committed May 21, 2022
2 parents eddc5fb + 42eb5c0 commit d53432f
Show file tree
Hide file tree
Showing 71 changed files with 1,363 additions and 892 deletions.
9 changes: 8 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
[alias]
xtask = "run --package xtask --"
xtask = "run --package xtask --release --"
git-proxy = "xtask git-proxy"
setup = "xtask setup"
update-all = "xtask update-all"

check-style = "xtask check-style"

rootfs = "xtask rootfs"
libc-test = "xtask libc-test"
other-test = "xtask other-test"
image = "xtask image"

asm = "xtask asm"
qemu = "xtask qemu"
gdb = "xtask gdb"
13 changes: 13 additions & 0 deletions .github/scripts/add-doc-index.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

cat > target/doc/index.html << EOF
<html>
<head>
<meta http-equiv="refresh" content="0;URL=kernel_hal/index.html">
<title>Redirection</title>
</head>
<body onload="window.location = 'kernel_hal/index.html'">
<p>Redirecting to <a href="kernel_hal/index.html">kernel_hal/index.html</a>...</p>
</body>
</html>
EOF
5 changes: 5 additions & 0 deletions .github/scripts/install-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

sudo apt-get update
sudo apt-get install -y $@
pip3 install -r tests/requirements.txt
7 changes: 7 additions & 0 deletions .github/scripts/install-qemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

wget https://download.qemu.org/qemu-$1.tar.xz
tar -xJf qemu-$1.tar.xz
cd qemu-$1
./configure --target-list=x86_64-softmmu,riscv64-softmmu
make -j$nproc > /dev/null 2>&1
36 changes: 24 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ on:
schedule:
- cron: '0 22 * * *' # every day at 22:00 UTC

env:
rust_toolchain: nightly-2022-01-20

jobs:
workspace:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-01-20
toolchain: ${{ env.rust_toolchain }}
override: true
components: rust-src, rustfmt, clippy

Expand All @@ -23,16 +27,19 @@ jobs:
with:
command: fmt
args: --all -- --check

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features

- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features

- name: Build docs
uses: actions-rs/cargo@v1
with:
Expand All @@ -43,33 +50,34 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-01-20
toolchain: ${{ env.rust_toolchain }}
override: true
target: aarch64-unknown-linux-gnu

- uses: actions-rs/cargo@v1
with:
command: build
use-cross: true
args: --target aarch64-unknown-linux-gnu --workspace --exclude linux-syscall --exclude zcore-loader --exclude zcore

build-user:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Pull prebuilt images
run: git lfs pull -I prebuilt/zircon/x64/libc.so,prebuilt/zircon/x64/libfdio.so,prebuilt/zircon/x64/libunwind.so,prebuilt/zircon/x64/libzircon.so,prebuilt/zircon/x64/Scrt1.o

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-01-20
toolchain: ${{ env.rust_toolchain }}
target: x86_64-fuchsia

- name: Build Zircon user programs
run: cd zircon-user && make build MODE=release

Expand All @@ -82,18 +90,19 @@ jobs:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-01-20
toolchain: ${{ env.rust_toolchain }}
components: rust-src, llvm-tools-preview, clippy
- uses: Swatinem/rust-cache@v1

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --package zcore --features "${{ matrix.mode }} libos"

- name: Clippy
uses: actions-rs/cargo@v1
with:
Expand All @@ -111,27 +120,30 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-01-20
toolchain: ${{ env.rust_toolchain }}
components: rust-src, llvm-tools-preview, clippy

- uses: actions-rs/[email protected]
with:
crate: cargo-binutils
version: latest
- uses: Swatinem/rust-cache@v1

- name: Build ${{ matrix.arch }} bare-metal zircon
if: matrix.arch == 'x86_64'
run: cd zCore && make build ARCH=${{ matrix.arch }}

- name: Clippy ${{ matrix.arch }} bare-metal zircon
if: matrix.arch == 'x86_64'
run: cd zCore && make clippy ARCH=${{ matrix.arch }}

- name: Build ${{ matrix.arch }} bare-metal linux
if: matrix.arch == 'riscv64'
run: cd zCore && make build ARCH=${{ matrix.arch }} LINUX=1

- name: Clippy ${{ matrix.arch }} bare-metal linux
if: matrix.arch == 'riscv64'
run: cd zCore && make clippy ARCH=${{ matrix.arch }} LINUX=1
21 changes: 8 additions & 13 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,25 @@ on:
push:
pull_request:

env:
rust_toolchain: nightly-2022-01-20

jobs:
doc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-01-20
- uses: Swatinem/rust-cache@v1
toolchain: ${{ env.rust_toolchain }}

- name: Build docs
run: |
cargo doc --no-deps --all-features
cat >target/doc/index.html <<EOF
<html>
<head>
<meta http-equiv="refresh" content="0;URL=kernel_hal/index.html">
<title>Redirection</title>
</head>
<body onload="window.location = 'kernel_hal/index.html'">
<p>Redirecting to <a href="kernel_hal/index.html">kernel_hal/index.html</a>...</p>
</body>
</html>
EOF
.github/scripts/add-doc-index.sh
- name: Deploy to Github Pages
if: ${{ github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@releases/v3
Expand Down
Loading

0 comments on commit d53432f

Please sign in to comment.