diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8762d7e..5d8f1e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,20 +10,17 @@ on: type: string -env: - repository: Starry-OS/Starry - jobs: prepare_for_external_test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - id: step1 - if: github.repository != ${{ env.repository }} + if: github.repository != 'Starry-OS/Starry' # 输出的值可以在后续的job中使用 run: echo "TopTestDirectory=${{ inputs.TopTestDirectory }}" >> $GITHUB_OUTPUT - id: step2 - if: github.repository == ${{ env.repository }} + if: github.repository == 'Starry-OS/Starry' run: echo "ToptTestDirectory=./" >> $GITHUB_OUTPUT outputs: TopTestDirectory: ${{ steps.step1.outputs.ToptTestDirectory || steps.step2.outputs.ToptTestDirectory }} @@ -57,8 +54,8 @@ jobs: with: arch: aarch64 - name: Clone Top Repository - if: github.repository != ${{ env.repository }} - run: git clone https://github.com/${{ env.repository }}.git ${{ env.WORKING_DIRECTORY }} + if: github.repository != 'Starry-OS/Starry' + run: git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} - name: Check rust version working-directory: ${{ env.WORKING_DIRECTORY }} run: rustc --version --verbose @@ -100,8 +97,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo install cargo-binutils - name: Clone Top Repository - if: github.repository != ${{ env.repository }} - run: git clone https://github.com/${{ env.repository }}.git ${{ env.WORKING_DIRECTORY }} + if: github.repository != 'Starry-OS/Starry' + run: git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} - name: Build helloworld working-directory: ${{ env.WORKING_DIRECTORY }} run: make ARCH=${{ matrix.arch }} A=apps/helloworld @@ -197,8 +194,8 @@ jobs: with: arch: x86_64 - name: Clone Top Repository - if: github.repository != ${{ env.repository }} - run: git clone https://github.com/${{ env.repository }}.git ${{ env.WORKING_DIRECTORY }} + 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 @@ -241,8 +238,8 @@ jobs: with: toolchain: ${{ matrix.rust-toolchain }} - name: Clone Top Repository - if: github.repository != ${{ env.repository }} - run: git clone https://github.com/${{ env.repository }}.git ${{ env.WORKING_DIRECTORY }} + if: github.repository != 'Starry-OS/Starry' + run: git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} - name: Build helloworld working-directory: ${{ env.WORKING_DIRECTORY }} run: cargo build -p arceos-helloworld @@ -305,8 +302,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo install cargo-binutils - name: Clone Top Repository - if: github.repository != ${{ env.repository }} - run: git clone https://github.com/${{ env.repository }}.git ${{ env.WORKING_DIRECTORY }} + if: github.repository != 'Starry-OS/Starry' + run: git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} - name: Bulld monolithic-userboot working-directory: ${{ env.WORKING_DIRECTORY }} run: | diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 04ee465..cf43318 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,6 @@ on: env: rust-toolchain: nightly-2024-05-02 - repository: Starry-OS/Starry jobs: prepare_for_external_test: @@ -19,11 +18,11 @@ jobs: steps: - uses: actions/checkout@v4 - id: step1 - if: github.repository != ${{ env.repository }} + if: github.repository != 'Starry-OS/Starry' # 输出的值可以在后续的job中使用 run: echo "TopTestDirectory=${{ inputs.ToptestDirectory }}" >> $GITHUB_OUTPUT - id: step2 - if: github.repository == ${{ env.repository }} + if: github.repository == 'Starry-OS/Starry' run: echo "ToptTestDirectory=./" >> $GITHUB_OUTPUT outputs: TopTestDirectory: ${{ steps.step1.outputs.ToptTestDirectory || steps.step2.outputs.ToptTestDirectory }} @@ -53,14 +52,14 @@ jobs: with: arch: aarch64 - name: Clone Top Repository - if: github.repository != ${{ env.repository }} - run: git clone https://github.com/${{ env.repository }}.git ${{ env.WORKING_DIRECTORY }} + 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 == env.repository }} + if: ${{ github.ref == env.default-branch }} && github.repository == 'Starry-OS/Starry' uses: JamesIves/github-pages-deploy-action@v4 with: single-commit: true