Skip to content

Commit ebafbae

Browse files
committed
Add initial precommit ci
1 parent 4128e16 commit ebafbae

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

.github/workflows/precommit.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# *******************************************************************************
2+
# Copyright 2025 Arm Limited and affiliates.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
# *******************************************************************************
17+
18+
name: "Precommit"
19+
20+
#* To avoid duplicate jobs running when both push and PR is satisfied, we use this:
21+
#* https://github.com/orgs/community/discussions/26940#discussioncomment-5686753
22+
on:
23+
push:
24+
branches: [main]
25+
paths:
26+
- "ML-Frameworks/pytorch-aarch64/**"
27+
pull_request:
28+
types: [opened, synchronize, reopened]
29+
paths:
30+
- "ML-Frameworks/pytorch-aarch64/**"
31+
#* allow manual trigger of workflow when needed.
32+
workflow_dispatch:
33+
34+
#* Stop stale workflows when pull requests are updated: https://stackoverflow.com/a/70972844
35+
#* Does not apply to the main branch.
36+
concurrency:
37+
group: ${{ github.workflow }}-${{ github.ref }}
38+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
39+
40+
# Declare default permissions as read only.
41+
permissions: read-all
42+
43+
jobs:
44+
build-and-test:
45+
strategy:
46+
matrix:
47+
config: [
48+
{ name: c7g, label: ah-ubuntu_22_04-c7g_4x-50, threading: OMP, toolset: gcc }
49+
]
50+
51+
runs-on: ${{ matrix.config.label }}
52+
steps:
53+
- name: Checkout Tool-Solutions
54+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
55+
with:
56+
path: Tool-Solutions
57+
58+
# Note: This will create a github actions cache
59+
- name: Get latest CMake and Ninja
60+
uses: lukka/get-cmake@56d043d188c3612951d8755da8f4b709ec951ad6 # v3.31.6
61+
with:
62+
cmakeVersion: 3.31.0
63+
ninjaVersion: 1.12.0
64+
65+
- name: Install openmp
66+
run: |
67+
sudo apt install -y libomp-dev
68+
69+
- name: Install gcc
70+
run: |
71+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
72+
sudo apt update -y
73+
sudo apt install -y g++-11
74+
75+
- name: setup python
76+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
77+
with:
78+
python-version: '3.10'
79+
80+
- name: Set up Docker
81+
uses: docker/setup-docker-action@v4
82+
83+
- name: Build Tool-Solutions PyTorch
84+
run: ${{ github.workspace }}/Tool-Solutions/ML-Frameworks/pytorch-aarch64/build.sh
85+
working-directory: ${{ github.workspace }}/Tool-Solutions
86+
87+
88+
# This job adds a check named "CI AArch64" that represents overall
89+
# workflow status and can be used in branch rulesets
90+
status:
91+
needs: build-and-test
92+
runs-on: ubuntu-latest
93+
name: "CI AArch64"
94+
steps:
95+
- name: Print success
96+
run: echo Success

0 commit comments

Comments
 (0)