diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fd1801..65a1e6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,32 +42,6 @@ jobs: toolchain: ${{ matrix.rust-toolchain }} components: rust-src, clippy, rustfmt 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 if: github.repository != 'Starry-OS/Starry' run: git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} @@ -113,7 +87,10 @@ jobs: - run: cargo install cargo-binutils - name: Clone Top Repository if: github.repository != 'Starry-OS/Starry' - run: git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} + run: | + git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} + mkdir .github/workflows/actions + mv ${{ env.WORKING_DIRECTORY }}/.github/workflows/actions/setup-musl .github/workflows/actions/setup-musl - name: Build helloworld working-directory: ${{ env.WORKING_DIRECTORY }} run: make ARCH=${{ matrix.arch }} A=apps/helloworld @@ -158,11 +135,6 @@ 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 @@ -210,17 +182,17 @@ jobs: targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat - uses: Swatinem/rust-cache@v2 - run: cargo install cargo-binutils + + - name: Clone Top Repository + if: github.repository != 'Starry-OS/Starry' + run: | + git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} + mkdir .github/workflows/actions + mv ${{ env.WORKING_DIRECTORY }}/.github/workflows/actions/setup-musl .github/workflows/actions/setup-musl - 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 - if: github.repository != 'Starry-OS/Starry' - run: git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} - name: Build helloworld for x86_64-pc-oslab working-directory: ${{ env.WORKING_DIRECTORY }} run: make PLATFORM=x86_64-pc-oslab A=apps/helloworld diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ceaff08..de9f693 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,8 @@ jobs: matrix: os: [ubuntu-latest] arch: [x86_64, riscv64, aarch64] + env: + WORKING_DIRECTORY: ${{ needs.prepare_for_external_test.outputs.TopTestDirectory }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -45,24 +47,21 @@ jobs: components: rust-src - uses: Swatinem/rust-cache@v2 - run: cargo install cargo-binutils - - uses: Starry-OS/Starry/.github/workflows/actions/setup-qemu@main + - name: Clone Top Repository 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 }} + run: | + git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} + mkdir .github/workflows/actions + mv ${{ env.WORKING_DIRECTORY }}/.github/workflows/actions/setup-musl .github/workflows/actions/setup-musl + mv ${{ env.WORKING_DIRECTORY }}/.github/workflows/actions/setup-qemu .github/workflows/actions/setup-qemu - 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 }} + working-directory: ${{ env.WORKING_DIRECTORY }} run: | make disk_img make test ARCH=${{ matrix.arch }} @@ -75,6 +74,8 @@ jobs: matrix: os: [ubuntu-latest] arch: [x86_64, riscv64, aarch64] + env: + WORKING_DIRECTORY: ${{ needs.prepare_for_external_test.outputs.TopTestDirectory }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -83,24 +84,21 @@ 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 + - name: Clone Top Repository if: github.repository != 'Starry-OS/Starry' - with: - arch: ${{ matrix.arch }} + run: | + git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} + mkdir .github/workflows/actions + mv ${{ env.WORKING_DIRECTORY }}/.github/workflows/actions/setup-musl .github/workflows/actions/setup-musl + mv ${{ env.WORKING_DIRECTORY }}/.github/workflows/actions/setup-qemu .github/workflows/actions/setup-qemu - 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 }} + working-directory: ${{ env.WORKING_DIRECTORY }} run: | make disk_img make test_monolithic ARCH=${{ matrix.arch }} @@ -112,6 +110,8 @@ jobs: matrix: os: [ubuntu-latest] arch: [x86_64, riscv64, aarch64] + env: + WORKING_DIRECTORY: ${{ needs.prepare_for_external_test.outputs.TopTestDirectory }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -120,20 +120,17 @@ 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 + - name: Clone Top Repository if: github.repository != 'Starry-OS/Starry' - with: - arch: ${{ matrix.arch }} + run: | + git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} + mkdir .github/workflows/actions + mv ${{ env.WORKING_DIRECTORY }}/.github/workflows/actions/setup-musl .github/workflows/actions/setup-musl + mv ${{ env.WORKING_DIRECTORY }}/.github/workflows/actions/setup-qemu .github/workflows/actions/setup-qemu - 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