|
1 | | -name: CI |
2 | | - |
3 | | -on: |
4 | | - pull_request: |
5 | | - push: |
6 | | - paths-ignore: |
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + paths-ignore: |
7 | 7 | - "**.md" |
8 | 8 | - "LICENSE" |
9 | 9 | workflow_dispatch: |
10 | | - inputs: |
11 | | - infinicore_branch: |
12 | | - description: "InfiniCore Branch Name" |
13 | | - required: false |
14 | | - default: "main" |
15 | | - type: string |
16 | 10 |
|
17 | 11 | jobs: |
18 | | - check-format: |
19 | | - name: Check Format |
| 12 | + refactor-host: |
| 13 | + name: Build and CLI host behavior |
20 | 14 | runs-on: ubuntu-latest |
21 | 15 | steps: |
22 | | - - name: checkout code |
23 | | - uses: actions/checkout@v4 |
| 16 | + - uses: actions/checkout@v4 |
24 | 17 | with: |
25 | | - fetch-depth: 0 |
26 | | - |
27 | | - - name: Install format dependencies |
| 18 | + submodules: recursive |
| 19 | + - uses: actions/setup-python@v5 |
| 20 | + with: |
| 21 | + python-version: '3.11' |
| 22 | + - name: Install host test dependency |
| 23 | + run: python -m pip install numpy==2.3.5 |
| 24 | + - name: Run selected host checks |
28 | 25 | run: | |
29 | | - python -m pip install clang-format==21.1.8 black ruff==0.15.20 colorama |
| 26 | + python -m unittest discover -s test/scripts -p "test_build_infini_stack.py" -v |
| 27 | + python -m unittest discover -s test/scripts -p "test_base_config_device_detection.py" -v |
30 | 28 |
|
31 | | - - name: Check Format |
32 | | - run: | |
33 | | - if [ "${{ github.event_name }}" = "pull_request" ]; then |
34 | | - python3 scripts/format.py --ref "origin/${{ github.base_ref }}" --check |
35 | | - elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then |
36 | | - python3 scripts/format.py --ref "${{ github.event.before }}" --check |
37 | | - else |
| 29 | + check-format: |
| 30 | + name: Check Format |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - name: checkout code |
| 34 | + uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + fetch-depth: 0 |
| 37 | + |
| 38 | + - name: Install format dependencies |
| 39 | + run: | |
| 40 | + python -m pip install clang-format==21.1.8 black ruff==0.15.20 colorama |
| 41 | +
|
| 42 | + - name: Check Format |
| 43 | + run: | |
| 44 | + if [ "${{ github.event_name }}" = "pull_request" ]; then |
| 45 | + python3 scripts/format.py --ref "origin/${{ github.base_ref }}" --check |
| 46 | + elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then |
| 47 | + python3 scripts/format.py --ref "${{ github.event.before }}" --check |
| 48 | + else |
38 | 49 | python3 scripts/format.py --ref origin/main --check |
39 | 50 | fi |
40 | 51 |
|
| 52 | + dependency-identity: |
| 53 | + if: github.event_name == 'workflow_dispatch' |
| 54 | + runs-on: ubuntu-latest |
| 55 | + outputs: |
| 56 | + infinicore_sha: ${{ steps.core.outputs.sha }} |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + submodules: recursive |
| 61 | + - id: core |
| 62 | + shell: bash |
| 63 | + run: | |
| 64 | + expected=$(git ls-tree HEAD third_party/InfiniCore | awk '$1==160000 {print $3}') |
| 65 | + actual=$(git -C third_party/InfiniCore rev-parse HEAD) |
| 66 | + test -n "$expected" && test "$actual" = "$expected" |
| 67 | + git submodule status --recursive | awk '/^[+-U]/ {bad=1} END {exit bad}' |
| 68 | + printf 'sha=%s\n' "$actual" >> "$GITHUB_OUTPUT" |
| 69 | +
|
41 | 70 | ci: |
42 | 71 | if: github.event_name == 'workflow_dispatch' |
43 | | - needs: check-format |
44 | | - uses: InfiniTensor/ci/.github/workflows/infinilm-ci.yml@infiniCore_ci |
| 72 | + needs: [check-format, dependency-identity] |
| 73 | + uses: InfiniTensor/ci/.github/workflows/infinilm-ci.yml@refactor/adopt-modern-infini-stack |
45 | 74 | with: |
46 | | - config_path: .github/ci_config.yaml |
47 | | - ci_ref: infiniCore_ci |
48 | | - infinicore_branch: ${{ github.event.inputs.infinicore_branch || 'main' }} |
| 75 | + config_path: .github/ci_config_nvidia.yaml |
| 76 | + ci_ref: refactor/adopt-modern-infini-stack |
| 77 | + infinicore_branch: ${{ needs.dependency-identity.outputs.infinicore_sha }} |
49 | 78 | secrets: inherit |
0 commit comments