Skip to content

Commit

Permalink
solve for relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure-stars committed May 15, 2024
1 parent 5bef800 commit c2f546e
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 22 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: echo "ToptTestDirectory=./" >> $GITHUB_OUTPUT
outputs:
TopTestDirectory: ${{ steps.step1.outputs.TopTestDirectory || steps.step2.outputs.TopTestDirectory }}

clippy:
needs: prepare_for_external_test
runs-on: ubuntu-latest
Expand All @@ -44,13 +44,28 @@ jobs:
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat
- name: Setup C++ environment
run: sudo apt-get update && sudo apt-get install -y build-essential
- uses: Starry-OS/Starry/.github/workflows/actions/setup-musl@main
if: github.repository != 'Starry-OS/Starry'
with:
arch: x86_64
- uses: Starry-OS/Starry/.github/workflows/actions/setup-musl@main
if: github.repository != 'Starry-OS/Starry'
with:
arch: riscv64
- uses: Starry-OS/Starry/.github/workflows/actions/setup-musl@main
if: github.repository != 'Starry-OS/Starry'
with:
arch: aarch64
- uses: ./.github/workflows/actions/setup-musl
if: github.repository == 'Starry-OS/Starry'
with:
arch: x86_64
- uses: ./.github/workflows/actions/setup-musl
if: github.repository == 'Starry-OS/Starry'
with:
arch: riscv64
- uses: ./.github/workflows/actions/setup-musl
if: github.repository == 'Starry-OS/Starry'
with:
arch: aarch64
- name: Clone Top Repository
Expand Down Expand Up @@ -143,6 +158,11 @@ jobs:
run: make ARCH=${{ matrix.arch }} A=apps/net/udpserver

- uses: ./.github/workflows/actions/setup-musl
if: github.repository == 'Starry-OS/Starry'
with:
arch: ${{ matrix.arch }}
- uses: Starry-OS/Starry/.github/workflows/actions/setup-musl@main
if: github.repository != 'Starry-OS/Starry'
with:
arch: ${{ matrix.arch }}
- name: Build c/helloworld
Expand Down Expand Up @@ -191,6 +211,11 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- uses: ./.github/workflows/actions/setup-musl
if: github.repository == 'Starry-OS/Starry'
with:
arch: x86_64
- uses: Starry-OS/Starry/.github/workflows/actions/setup-musl@main
if: github.repository != 'Starry-OS/Starry'
with:
arch: x86_64
- name: Clone Top Repository
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
contents: write
env:
default-branch: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }}
WORKING_DIRECTORY: ${{ needs.prepare_for_external_test.outputs.TopTestDirectory }}
Expand All @@ -42,26 +40,32 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust-toolchain }}
- uses: ./.github/workflows/actions/setup-musl
with:
arch: x86_64
- uses: ./.github/workflows/actions/setup-musl
with:
arch: riscv64
- uses: ./.github/workflows/actions/setup-musl
with:
arch: aarch64
- name: Clone Top Repository
if: github.repository != 'Starry-OS/Starry'
run: git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }}
- name: Build docs
working-directory: ${{ env.WORKING_DIRECTORY }}
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
run: make doc_check_missing
- name: Deploy to Github Pages
if: ${{ github.ref == env.default-branch }} && github.repository == 'Starry-OS/Starry'
uses: JamesIves/github-pages-deploy-action@v4
with:
single-commit: true
branch: gh-pages
folder: target/doc

deploy:
if: github.repository == 'Starry-OS/Starry'
needs: doc
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
contents: write
env:
default-branch: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }}
steps:
- name: Build docs
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
run: make doc_check_missing
- name: Deploy to Github Pages
if: ${{ github.ref == env.default-branch }}
uses: JamesIves/github-pages-deploy-action@v4
with:
single-commit: true
branch: gh-pages
folder: target/doc
63 changes: 60 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
name: Test CI

on: [push, pull_request]


on:
push:
pull_request:
workflow_call:
inputs:
TopTestDirectory:
required: true
type: string

env:
qemu-version: 8.2.0
rust-toolchain: nightly-2024-05-02

jobs:
prepare_for_external_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: step1
if: github.repository != 'Starry-OS/Starry'
# 输出的值可以在后续的job中使用
run: echo "TopTestDirectory=${{ inputs.TopTestDirectory }}" >> $GITHUB_OUTPUT
- id: step2
if: github.repository == 'Starry-OS/Starry'
run: echo "ToptTestDirectory=./" >> $GITHUB_OUTPUT
outputs:
TopTestDirectory: ${{ steps.step1.outputs.TopTestDirectory || steps.step2.outputs.TopTestDirectory }}


app-test-for-unikernel:
needs: prepare_for_external_test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -23,18 +45,30 @@ jobs:
components: rust-src
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- uses: Starry-OS/Starry/.github/workflows/actions/setup-qemu@main
if: github.repository != 'Starry-OS/Starry'
with:
qemu-version: ${{ env.qemu-version }}
- uses: Starry-OS/Starry/.github/workflows/actions/setup-musl@main
if: github.repository != 'Starry-OS/Starry'
with:
arch: ${{ matrix.arch }}
- uses: ./.github/workflows/actions/setup-qemu
if: github.repository == 'Starry-OS/Starry'
with:
qemu-version: ${{ env.qemu-version }}
- uses: ./.github/workflows/actions/setup-musl
if: github.repository == 'Starry-OS/Starry'
with:
arch: ${{ matrix.arch }}
- name: Run app tests
working-directory: ${{ needs.prepare_for_external_test.outputs.TopTestDirectory }}
run: |
make disk_img
make test ARCH=${{ matrix.arch }}
app-test-for-monolithic:
needs: prepare_for_external_test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -49,17 +83,29 @@ jobs:
components: rust-src
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- uses: Starry-OS/Starry/.github/workflows/actions/setup-qemu@main
if: github.repository != 'Starry-OS/Starry'
with:
qemu-version: ${{ env.qemu-version }}
- uses: Starry-OS/Starry/.github/workflows/actions/setup-musl@main
if: github.repository != 'Starry-OS/Starry'
with:
arch: ${{ matrix.arch }}
- uses: ./.github/workflows/actions/setup-qemu
if: github.repository == 'Starry-OS/Starry'
with:
qemu-version: ${{ env.qemu-version }}
- uses: ./.github/workflows/actions/setup-musl
if: github.repository == 'Starry-OS/Starry'
with:
arch: ${{ matrix.arch }}
- name: Run app tests
working-directory: ${{ needs.prepare_for_external_test.outputs.TopTestDirectory }}
run: |
make disk_img
make test_monolithic ARCH=${{ matrix.arch }}
app-test-for-ext4fs:
needs: prepare_for_external_test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -74,13 +120,24 @@ jobs:
components: rust-src
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- uses: Starry-OS/Starry/.github/workflows/actions/setup-qemu@main
if: github.repository != 'Starry-OS/Starry'
with:
qemu-version: ${{ env.qemu-version }}
- uses: Starry-OS/Starry/.github/workflows/actions/setup-musl@main
if: github.repository != 'Starry-OS/Starry'
with:
arch: ${{ matrix.arch }}
- uses: ./.github/workflows/actions/setup-qemu
if: github.repository == 'Starry-OS/Starry'
with:
qemu-version: ${{ env.qemu-version }}
- uses: ./.github/workflows/actions/setup-musl
if: github.repository == 'Starry-OS/Starry'
with:
arch: ${{ matrix.arch }}
- name: Run app tests
working-directory: ${{ needs.prepare_for_external_test.outputs.TopTestDirectory }}
run: |
sh ./build_img.sh -m ${{ matrix.arch }} -fs ext4
export MONOLITHIC_TESTCASE=other
Expand Down

0 comments on commit c2f546e

Please sign in to comment.