Repository navigation
104 lines (83 loc) · 2.43 KB
/
Copy pathci.yml
File metadata and controls
104 lines (83 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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:
- S60
# 禁止 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
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