Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Modify CI and add workflow call to implement externel test #188

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/actions/ext-patch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Checkout repo and patch dependencies

inputs:
package:
description: 'The package that triggers the external test'
required: true
type: string

runs:
using: "composite"
steps:
- name: Install patch tool
if: inputs.package != ''
shell: bash
run: cargo install dependencies-patch
- name: Patch for the commit to be tested
if: inputs.package != ''
shell: bash
run: dependencies-patch -c .
-n ${{ inputs.package }}
-t git --git-repo ${{ github.repository }}
--commit ${{ github.sha }}
36 changes: 35 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
name: Build CI

on: [push, pull_request]
on:
push:
pull_request:
workflow_call:
inputs:
package:
description: 'The package that triggers the workflow'
required: true
type: string
ref:
description: 'The branch of the main repository'
required: false
default: 'main'
type: string

env:
prj-repo: "arceos-org/arceos"

jobs:
clippy:
Expand All @@ -13,6 +29,15 @@ jobs:
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
steps:
- uses: actions/checkout@v4
if: inputs.package == ''
- uses: actions/checkout@v4
if: inputs.package != ''
with:
repository: ${{ env.prj-repo }}
ref: ${{ inputs.ref }}
- uses: ./.github/workflows/actions/ext-patch
with:
package: ${{ inputs.package }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
Expand Down Expand Up @@ -48,6 +73,15 @@ jobs:
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
steps:
- uses: actions/checkout@v4
if: inputs.package == ''
- uses: actions/checkout@v4
if: inputs.package != ''
with:
repository: ${{ env.prj-repo }}
ref: ${{ inputs.ref }}
- uses: ./.github/workflows/actions/ext-patch
with:
package: ${{ inputs.package }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
Expand Down
34 changes: 33 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
name: Test CI

on: [push, pull_request]
on:
push:
pull_request:
workflow_call:
inputs:
package:
description: 'The package that triggers the workflow'
required: true
type: string
ref:
description: 'The branch of the main repository'
required: false
default: 'main'
type: string

env:
qemu-version: 8.2.0
rust-toolchain: nightly-2024-05-02
arceos-apps: 'da1caa5'
prj-repo: "arceos-org/arceos"

jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: inputs.package == ''
- uses: actions/checkout@v4
if: inputs.package != ''
with:
repository: ${{ env.prj-repo }}
ref: ${{ inputs.ref }}
- uses: ./.github/workflows/actions/ext-patch
with:
package: ${{ inputs.package }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust-toolchain }}
Expand All @@ -28,6 +51,15 @@ jobs:
arch: [x86_64, riscv64, aarch64]
steps:
- uses: actions/checkout@v4
if: inputs.package == ''
- uses: actions/checkout@v4
if: inputs.package != ''
with:
repository: ${{ env.prj-repo }}
ref: ${{ inputs.ref }}
- uses: ./.github/workflows/actions/ext-patch
with:
package: ${{ inputs.package }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust-toolchain }}
Expand Down
Loading