-
Notifications
You must be signed in to change notification settings - Fork 31
134 lines (113 loc) · 3.87 KB
/
Copy pathcheck-pr.yaml
File metadata and controls
134 lines (113 loc) · 3.87 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
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.12'
- name: "Run configure"
run: |
./ccex configure format
- name: "Run linters"
run: |
./ccex format --no-apply-patches
build-and-test:
runs-on: ubuntu-22.04
strategy:
matrix:
torch-version: ["2.5", "2.6", "2.7", "2.8", "nightly"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Import all commit history and tag
- name: Get Ubuntu codename
id: os
run: |
CODENAME=$(lsb_release -cs)
echo "codename=$CODENAME" >> "$GITHUB_OUTPUT"
- name: Specify ONE version and binary
id: one
run: |
VERSION=1.30.1
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "filename=one-compiler-${{ steps.os.outputs.codename }}_${VERSION}_amd64.deb" >> "$GITHUB_OUTPUT"
- name: Download one-compiler package
id: download
uses: ./.github/actions/download-release-asset
with:
owner: Samsung
repo: ONE
tag: ${{ steps.one.outputs.version }}
filename: ${{ steps.one.outputs.filename }}
- name: "Install one-compiler"
working-directory: ./.github/actions/download-release-asset
run: |
sudo dpkg -i ${{ steps.one.outputs.filename }}
sudo apt-get install -f -y
onecc --version || echo "Installation failed."
- name: Trust all directories for Git
run: |
# Enable access to git from 'versioningit'
git config --global --add safe.directory "*"
- name: "Build package"
run: |
pip install build
./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/"