-
Notifications
You must be signed in to change notification settings - Fork 31
145 lines (123 loc) · 4.28 KB
/
Copy pathcheck-pr.yaml
File metadata and controls
145 lines (123 loc) · 4.28 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Check PR
on:
pull_request:
branches:
- main
- rel/*
jobs:
check-commit-message:
name: Check commit message
runs-on: ubuntu-22.04
# Skip on draft, check on draft -> ready
if: github.repository_owner == 'Samsung' && github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
# Checkout PR head commit
# Checkout Action use merge commit as default
ref: ${{ github.event.pull_request.head.sha }}
# Fetch all history and branch (default: 1)
fetch-depth: 0
- name: "Check signed-off"
run: |
# Get commit body
git log origin/"$GITHUB_BASE_REF"..HEAD --format=%b > commit_msg.txt
sed "/^$/d" commit_msg.txt > commit_body.txt
# Check string starting from "TICO-DCO-1.0-Signed-off-by:"
count="$(grep -c "TICO-DCO-1.0-Signed-off-by:" commit_body.txt)"
if [[ ! "$count" -ge "1" ]]; then
echo "Your commit message does not contain the expected signoff information."
echo "Please add a line like 'TICO-DCO-1.0-Signed-off-by: <NAME> <<EMAIL>>' to your commit message."
echo "Refer to https://github.com/Samsung/TICO/wiki/TICO-Developer-Certificate-of-Origin"
exit 1
fi
echo "TICO-DCO-1.0-Signed-off-by is OK"
check-style:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: "Run configure"
run: |
./ccex configure format
- name: "Run linters"
run: |
./ccex format --no-apply-patches
build-and-test:
runs-on: tico-linux
container:
image: samsungonedev.azurecr.io/ubuntu:22.04
strategy:
matrix:
torch-version: ["2.5", "2.6", "nightly"] # TODO: Add 2.7 when it is released
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y curl git lsb-release unzip
- uses: actions/checkout@v4
- name: Install python dependencies
run: |
apt-get install -y python3-venv python3-pip
- name: Get Ubuntu codename
id: os
run: |
CODENAME=$(lsb_release -cs)
echo "codename=$CODENAME" >> "$GITHUB_OUTPUT"
# TODO Enable this step after one-compiler 1.30.0 release.
# - name: Download one-compiler package
# id: download
# uses: ./.github/actions/download-release-asset
# with:
# owner: Samsung
# repo: ONE
# tag: 1.30.0
# filename: one-compiler-${{ steps.os.outputs.codename }}_1.30.0_amd64.deb
# - name: "Install one-compiler"
# run: |
# dpkg -i ${{ steps.download.outputs.filename }}
# apt-get install -f -y
# onecc --version
- name: Download issue attatchment (one-compiler latest)
run: |
curl -L -o one-compiler-latest.zip \
"https://github.com/user-attachments/files/19561702/one-compiler_1.30.0.25040116_amd64.zip"
- name: Unzip and install the one-compiler package
run: |
unzip one-compiler-latest.zip -d one-compiler-package
ls -l one-compiler-package
dpkg -i one-compiler-package/*.deb
apt-get install -f -y # fix dependencies if needed
- name: Check installation
run: |
onecc --version || echo "Installation failed."
- name: "Build package"
run: |
pip install setuptools
./ccex build
- name: "Run install"
shell: bash
run: |
TORCH_VERSION=${{ matrix.torch-version }}
./ccex install --dist --torch_ver $TORCH_VERSION
pt2-to-circle -h
- name: "Configure test"
shell: bash
run: |
TORCH_VERSION=${{ matrix.torch-version }}
./ccex configure test --torch_ver $TORCH_VERSION
- name: "Show torch package versions"
shell: bash
run: |
pip list | grep torch
- name: "Run test"
shell: bash
run: |
./ccex test
- name: "Upload artifact"
uses: actions/upload-artifact@v4
with:
name: "wheel-${{ matrix.torch-version }}"
path: "./dist/"