Repository navigation
Fix path to build.sh in CI workflow #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: DeepGEMM CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| CI_IMAGE: registry-egc.enflame-tech.com/artifacts/public_pytorch:v2.11.0-TR3.8.106-ubuntu2204 | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: | |
| - self-hosted | |
| - Linux | |
| - X64 | |
| # 禁止 fork PR 在特权自托管 Runner 上执行 | |
| if: >- | |
| github.event_name != 'pull_request' || | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Show environment and verify scripts | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| echo "Workspace: ${GITHUB_WORKSPACE}" | |
| pwd | |
| ls -la | |
| echo "CI scripts:" | |
| find . -maxdepth 4 -type f \ | |
| \( -name "build.sh" \ | |
| -o -name "install_driver.sh" \ | |
| -o -name "install_env.sh" \ | |
| -o -name "run_test_all.sh" \ | |
| -o -name "run_all_test.sh" \) \ | |
| test -f build.sh | |
| test -f tests/install_driver.sh | |
| test -f tests/install_env.sh | |
| test -f tests/run_test_all.sh | |
| sudo docker version | |
| - name: Install driver on runner host | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| sudo bash tests/install_driver.sh | |
| - name: Pull CI image | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| sudo docker pull "${CI_IMAGE}" | |
| - name: Run CI build and tests | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| sudo docker run --rm \ | |
| --privileged \ | |
| --ipc=host \ | |
| --user 0:0 \ | |
| --volume="${GITHUB_WORKSPACE}:/app" \ | |
| --volume=/log:/log \ | |
| --volume=/root:/root \ | |
| --volume=/lib/modules:/lib/modules \ | |
| --volume=/usr/src:/usr/src \ | |
| --volume=/dev:/dev \ | |
| --volume=/home/pypi_packages:/home/pypi_packages \ | |
| --workdir=/app \ | |
| "${CI_IMAGE}" \ | |
| bash -lc ' | |
| set -euo pipefail | |
| git config --global --add safe.directory /app | |
| echo "========== Build DeepGEMM ==========" | |
| bash build.sh ci_build | |
| echo "========== Install test environment ==========" | |
| bash tests/install_env.sh | |
| echo "========== Run all tests ==========" | |
| bash tests/run_test_all.sh all | |
| ' | |
| - name: Fix workspace permissions | |
| if: always() | |
| shell: bash | |
| run: | | |
| if [[ -d "${GITHUB_WORKSPACE}" ]]; then | |
| sudo chown -R \ | |
| "$(id -u):$(id -g)" \ | |
| "${GITHUB_WORKSPACE}" || true | |
| fi |