Skip to content

Commit

Permalink
chore: add branch option for CI-CD
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure-stars committed May 21, 2024
1 parent d2e7978 commit dab0852
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ on:
description: 'The commit of the repository to call the workflow'
required: true
type: string
TopBranch:
description: 'The branch of the main repository'
required: true
type: string
default: 'main'

jobs:
prepare_for_external_test:
Expand Down Expand Up @@ -57,7 +62,7 @@ jobs:
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat
- 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 }} && cd ${{ env.WORKING_DIRECTORY }} && git checkout ${{ inputs.TopBranch }}
- name: Check rust version
working-directory: ${{ env.WORKING_DIRECTORY }}
run: rustc --version --verbose
Expand Down Expand Up @@ -101,7 +106,7 @@ jobs:
- name: Clone Top Repository
if: github.repository != 'Starry-OS/Starry'
run: |
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }}
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} && cd ${{ env.WORKING_DIRECTORY }} && git checkout ${{ inputs.TopBranch }} && cd ..
sh ${{ env.WORKING_DIRECTORY }}/scripts/test/external_test.sh ${{ env.WORKING_DIRECTORY }} ${{ inputs.CallerPackage }} ${{ inputs.CallerRepository }} ${{ inputs.CallerCommit }}
- name: Update Top Repository
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down Expand Up @@ -201,7 +206,7 @@ jobs:
- name: Clone Top Repository
if: github.repository != 'Starry-OS/Starry'
run: |
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }}
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} && cd ${{ env.WORKING_DIRECTORY }} && git checkout ${{ inputs.TopBranch }} && cd ..
sh ${{ env.WORKING_DIRECTORY }}/scripts/test/external_test.sh ${{ env.WORKING_DIRECTORY }} ${{ inputs.CallerPackage }} ${{ inputs.CallerRepository }} ${{ inputs.CallerCommit }}
- name: Update Top Repository
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down Expand Up @@ -253,7 +258,7 @@ jobs:
- name: Clone Top Repository
if: github.repository != 'Starry-OS/Starry'
run: |
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }}
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} && cd ${{ env.WORKING_DIRECTORY }} && git checkout ${{ inputs.TopBranch }} && cd ..
sh ${{ env.WORKING_DIRECTORY }}/scripts/test/external_test.sh ${{ env.WORKING_DIRECTORY }} ${{ inputs.CallerPackage }} ${{ inputs.CallerRepository }} ${{ inputs.CallerCommit }}
- name: Update Top Repository
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down Expand Up @@ -322,7 +327,7 @@ jobs:
- name: Clone Top Repository
if: github.repository != 'Starry-OS/Starry'
run: |
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }}
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} && cd ${{ env.WORKING_DIRECTORY }} && git checkout ${{ inputs.TopBranch }} && cd ..
sh ${{ env.WORKING_DIRECTORY }}/scripts/test/external_test.sh ${{ env.WORKING_DIRECTORY }} ${{ inputs.CallerPackage }} ${{ inputs.CallerRepository }} ${{ inputs.CallerCommit }}
- name: Update Top Repository
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ on:
description: 'The commit of the repository to call the workflow'
required: true
type: string

TopBranch:
description: 'The branch of the main repository'
required: true
type: string
default: 'main'
env:
qemu-version: 8.2.0
rust-toolchain: nightly-2024-05-02
Expand Down Expand Up @@ -63,7 +67,7 @@ jobs:
- name: Clone Top Repository
if: github.repository != 'Starry-OS/Starry'
run: |
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }}
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} && cd ${{ env.WORKING_DIRECTORY }} && git checkout ${{ inputs.TopBranch }} && cd ..
sh ${{ env.WORKING_DIRECTORY }}/scripts/test/external_test.sh ${{ env.WORKING_DIRECTORY }} ${{ inputs.CallerPackage }} ${{ inputs.CallerRepository }} ${{ inputs.CallerCommit }}
- name: Update Top Repository
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down Expand Up @@ -101,7 +105,7 @@ jobs:
- name: Clone Top Repository
if: github.repository != 'Starry-OS/Starry'
run: |
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }}
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} && cd ${{ env.WORKING_DIRECTORY }} && git checkout ${{ inputs.TopBranch }} && cd ..
sh ${{ env.WORKING_DIRECTORY }}/scripts/test/external_test.sh ${{ env.WORKING_DIRECTORY }} ${{ inputs.CallerPackage }} ${{ inputs.CallerRepository }} ${{ inputs.CallerCommit }}
- name: Update Top Repository
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down Expand Up @@ -138,7 +142,7 @@ jobs:
- name: Clone Top Repository
if: github.repository != 'Starry-OS/Starry'
run: |
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }}
git clone https://github.com/Starry-OS/Starry.git ${{ env.WORKING_DIRECTORY }} && cd ${{ env.WORKING_DIRECTORY }} && git checkout ${{ inputs.TopBranch }} && cd ..
sh ${{ env.WORKING_DIRECTORY }}/scripts/test/external_test.sh ${{ env.WORKING_DIRECTORY }} ${{ inputs.CallerPackage }} ${{ inputs.CallerRepository }} ${{ inputs.CallerCommit }}
- name: Update Top Repository
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down

0 comments on commit dab0852

Please sign in to comment.