Skip to content

[CICD] Add build and test CI workflows for Ascend and Metax #455

[CICD] Add build and test CI workflows for Ascend and Metax

[CICD] Add build and test CI workflows for Ascend and Metax #455

Workflow file for this run

# Copyright 2026 FlagOS Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: all_tests
on:
push:
branches: ["main"]
paths-ignore:
- 'docs/**'
- 'docker/**'
- 'tools/install/**'
- 'requirements/**'
- '.github/workflows/build_image.yml'
- '.github/workflows/build_image_common.yml'
pull_request:
branches: ["main"]
paths-ignore:
- 'docs/**'
- 'docker/**'
- 'tools/install/**'
- 'requirements/**'
- '.github/workflows/build_image.yml'
- '.github/workflows/build_image_common.yml'
workflow_dispatch:
inputs:
platform:
description: Platform test suite to run
required: true
default: all
type: choice
options:
- all
- cuda
- ascend
- metax
- musa
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.actor }}
cancel-in-progress: true
jobs:
cuda_tests:
name: CUDA tests
if: github.event_name != 'workflow_dispatch' || inputs.platform == 'all' || inputs.platform == 'cuda'
uses: ./.github/workflows/all_tests_common.yml
with:
platform: cuda
ascend_tests:
name: Ascend tests
if: github.event_name != 'workflow_dispatch' || inputs.platform == 'all' || inputs.platform == 'ascend'
uses: ./.github/workflows/all_tests_common.yml
with:
platform: ascend
metax_tests:
name: MetaX tests
if: github.event_name != 'workflow_dispatch' || inputs.platform == 'all' || inputs.platform == 'metax'
uses: ./.github/workflows/all_tests_common.yml
with:
platform: metax
musa_tests:
name: MThreads MUSA tests
if: github.event_name != 'workflow_dispatch' || inputs.platform == 'all' || inputs.platform == 'musa'
uses: ./.github/workflows/all_tests_common.yml
with:
platform: musa
all_tests:
name: all_tests
needs:
- cuda_tests
- ascend_tests
- metax_tests
- musa_tests
runs-on: ubuntu-latest
if: always()
steps:
- name: Verify workflow status
run: |
failed=false
if [ "${{ needs.cuda_tests.result }}" != "success" ] && \
[ "${{ needs.cuda_tests.result }}" != "skipped" ]; then
echo "CUDA tests failed"
failed=true
fi
if [ "${{ needs.ascend_tests.result }}" != "success" ] && \
[ "${{ needs.ascend_tests.result }}" != "skipped" ]; then
echo "❌ Ascend tests failed"
failed=true
fi
if [ "${{ needs.metax_tests.result }}" != "success" ] && \
[ "${{ needs.metax_tests.result }}" != "skipped" ]; then
echo "❌ MetaX C550 tests failed"
failed=true
fi
if [ "${{ needs.musa_tests.result }}" != "success" ] && \
[ "${{ needs.musa_tests.result }}" != "skipped" ]; then
echo "MThreads MUSA tests failed"
failed=true
fi
if [ "$failed" = "true" ]; then
exit 1
fi
echo "✅ All requested platform tests passed!"