Skip to content

Commit ca0122c

Browse files
step-security-botmgouicem
authored andcommitted
github: workflows: harden GitHub actions
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> Change-Id: Ie5df8d70a222e5e2b744ce32c1a653272646b167
1 parent a873a1c commit ca0122c

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

.github/workflows/ci-aarch64.yml

+28-7
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,39 @@ jobs:
4343
config: [Debug, Release]
4444

4545
steps:
46+
- name: Get number of CPU cores
47+
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2.0.0
48+
id: cpu-cores
4649
- name: Checkout oneDNN
4750
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4851
with:
4952
path: oneDNN
50-
51-
- name: Install Scons
53+
# ACL is built with clang, so we can link with it directly if we are using
54+
# clang as well.
55+
- if: matrix.compiler.CC == 'clang'
56+
name: Download and Extract ACL
57+
run: ${{ github.workspace }}/oneDNN/.github/automation/get_acl.sh
58+
env:
59+
ACL_WITH_ASSERTS: ${{ matrix.config.ACL_WITH_ASSERTS }}
60+
ACL_VERSION: ${{ github.event.inputs.ACL_VERSION || 'v24.08.1' }}
61+
# If we are building with gcc, we need to clone and build ACL ourselves to
62+
# link properly.
63+
- if: contains( matrix.compiler.CC , 'gcc' )
64+
name: Install Scons
5265
uses: threeal/pipx-install-action@b0bf0add7d5aefda03a3d4e47d651df807889e10 # v1.0.0
5366
with:
5467
packages: scons
55-
56-
- name: Build ACL
57-
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
68+
- if: contains( matrix.compiler.CC , 'gcc' )
69+
name: Checkout ACL
70+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
71+
with:
72+
repository: ARM-software/ComputeLibrary
73+
ref: 'v24.08.1'
74+
path: ComputeLibrary
75+
- if: contains( matrix.compiler.CC , 'gcc' )
76+
name: Build ACL
77+
working-directory: ${{ github.workspace }}/ComputeLibrary
78+
run: scons Werror=1 -j${{ steps.cpu-cores.outputs.count }} neon=1 opencl=0 os=macos arch=armv8.2-a build=native cppthreads=0 openmp=0 examples=0 validation_tests=0
5879
env:
5980
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
6081
BUILD_TOOLSET: ${{ matrix.toolset }}
@@ -87,7 +108,7 @@ jobs:
87108
toolset: [clang, gcc]
88109
config: [Debug, Release]
89110
host: [
90-
{ name: c6g, label: ah-ubuntu_22_04-c6g_2x-50 },
111+
{ name: c6g, label: ah-ubuntu_22_04-c6g_2x-50 },
91112
{ name: c7g, label: ah-ubuntu_22_04-c7g_2x-50 }
92113
]
93114

@@ -148,4 +169,4 @@ jobs:
148169
BUILD_TOOLSET: ${{ matrix.toolset }}
149170
CMAKE_BUILD_TYPE: ${{ matrix.config }}
150171
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build
151-
ONEDNN_THREADING: ${{ matrix.threading }}
172+
ONEDNN_THREADING: ${{ matrix.threading }}

.github/workflows/labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
pull-requests: write
2929

3030
steps:
31-
- uses: actions/labeler@v5.0.0
31+
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
3232
with:
3333
sync-labels: true
3434
configuration-path: '.github/labels.yml'

0 commit comments

Comments
 (0)