|
4 | 4 | # Trigger the workflow on push or pull request, |
5 | 5 | # but only for the main branch |
6 | 6 | workflow_dispatch: |
| 7 | + release: |
| 8 | + types: |
| 9 | + - created |
7 | 10 | pull_request: |
8 | 11 | branches: |
9 | 12 | - main |
@@ -53,11 +56,11 @@ jobs: |
53 | 56 | is_pull_request: ${{ github.event_name == 'pull_request' }} |
54 | 57 |
|
55 | 58 | # ============================================================ |
56 | | - # Unified Jobs: Build NeuG + run C++, Python, and E2E tests |
| 59 | + # Push / workflow_dispatch: build both x86_64 and arm64 |
57 | 60 | # ============================================================ |
58 | 61 | build_and_test_linux_x86_64: |
59 | 62 | needs: format_check |
60 | | - if: ${{ (needs.format_check.result == 'success' || needs.format_check.result == 'skipped') && (github.event_name != 'push' || github.repository != 'alibaba/neug' || github.ref == 'refs/heads/main') }} |
| 63 | + if: ${{ (needs.format_check.result == 'success' || needs.format_check.result == 'skipped') && (github.event_name != 'push' || github.repository != 'alibaba/neug' || github.ref == 'refs/heads/main') && contains(fromJSON('["push", "workflow_dispatch", "release"]'), github.event_name) }} |
61 | 64 | uses: ./.github/workflows/build-and-test-common.yml |
62 | 65 | with: |
63 | 66 | runs-on: ${{ github.repository == 'alibaba/neug' && '["self-hosted", "daily", "linux", "x64"]' || '["ubuntu-22.04"]' }} |
|
70 | 73 |
|
71 | 74 | build_and_test_linux_arm64: |
72 | 75 | needs: format_check |
73 | | - if: ${{ (needs.format_check.result == 'success' || needs.format_check.result == 'skipped') && (github.event_name != 'push' || github.repository != 'alibaba/neug' || github.ref == 'refs/heads/main') }} |
| 76 | + if: ${{ (needs.format_check.result == 'success' || needs.format_check.result == 'skipped') && (github.event_name != 'push' || github.repository != 'alibaba/neug' || github.ref == 'refs/heads/main') && contains(fromJSON('["push", "workflow_dispatch", "release"]'), github.event_name) }} |
74 | 77 | uses: ./.github/workflows/build-and-test-common.yml |
75 | 78 | with: |
76 | 79 | runs-on: ${{ github.repository == 'alibaba/neug' && '["self-hosted", "daily", "linux", "arm64"]' || '["ubuntu-22.04-arm"]' }} |
|
80 | 83 | enable-coverage: true |
81 | 84 | enable-gopt-test: true |
82 | 85 | event-name: ${{ github.event_name }} |
| 86 | + |
| 87 | + # ============================================================ |
| 88 | + # Pull Request: run a single random architecture |
| 89 | + # - self-hosted: omit arch label to let the runner pool pick randomly |
| 90 | + # - GitHub-hosted: fallback to x86_64 (ubuntu-22.04) |
| 91 | + # ============================================================ |
| 92 | + build_and_test_linux_pr: |
| 93 | + name: Build and test Linux (PR random arch) |
| 94 | + needs: format_check |
| 95 | + if: ${{ (needs.format_check.result == 'success' || needs.format_check.result == 'skipped') && github.event_name == 'pull_request' }} |
| 96 | + uses: ./.github/workflows/build-and-test-common.yml |
| 97 | + with: |
| 98 | + runs-on: ${{ github.repository == 'alibaba/neug' && '["self-hosted", "daily", "linux"]' || '["ubuntu-22.04"]' }} |
| 99 | + container-json: '{"image":"neug-registry.cn-hongkong.cr.aliyuncs.com/neug/neug-dev:v0.1.3"}' |
| 100 | + os-type: linux |
| 101 | + enable-java-test: true |
| 102 | + enable-coverage: true |
| 103 | + enable-gopt-test: true |
| 104 | + event-name: ${{ github.event_name }} |
0 commit comments